开发者

Eclipse and python: library will import in interprer, but not in IDE

开发者 https://www.devze.com 2022-12-29 17:41 出处:网络
I\'m running Windows 7, Python 2.6.4 and the latest version of Eclipse.I downloaded the boto library (http://code.google.com/p/boto/) and ran python setup.py install, which created boto-1.9b-py2.6.egg

I'm running Windows 7, Python 2.6.4 and the latest version of Eclipse. I downloaded the boto library (http://code.google.com/p/boto/) and ran python setup.py install, which created boto-1.9b-py2.6.egg in C:\Python26\Lib\site-packages.

Importing a c开发者_运维技巧lass - say, by doing 'from boto.sqs.connection import SQSConnection' - works fine from the python command line tool. But Eclipse will not find boto, despite the fact that it is using the same python interpreter as I am using when at the command line. I added the library as an external source folder, but that didn't work either. How can I properly import the boto library into Eclipse?

Thanks.


From the comment so can be marked as answered

In Preferences->Pydev->interpreter - Python what is the System libs value


For libraries that are required only in a single project, the best practice is to add them to the Project's PYTHONPATH and not the SYSTEM PYTHONPATH.

This is done by right clicking on the project -> Properties -> PyDev-PYTHONPATH -> External Libraries and then adding the required library using Add zip/jar/egg.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号