开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜