在 Eclipse 中刷新 PyDev 导入路径
我在 Ubuntu 下使用 Eclipse Helios。
每当我使用 pip
在 /usr/local/lib/python2.6/dist-packages/
下安装新库时,Eclipse 就看不到它并抱怨导入无效。我仔细检查了图书馆是否就位。从解释器导入它是有效的。刷新 PyDev 配置或重新启动 IDE 不起作用。注意:提到的路径位于Python解释器选项卡中的库路径列表中。
有谁知道对此的补救措施,如果不知道如何找出实际原因。
I'm using Eclipse Helios under Ubuntu.
Whenever I install a new library under /usr/local/lib/python2.6/dist-packages/
using pip
, Eclipse doesn't see it and complains about invalid imports. I double checked the library is in place. Importing it works from the interpreter. Refreshing the PyDev configuration or restarting the IDE doesn't work. Note: the mentioned path is on the list of library paths in the Python interpreter tab.
Does anybody know of a remedy to this, and if not how to track down the actual cause.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是我从一个鸡蛋安装了这个库。 Egg 文件夹需要手动添加,否则 PyDev 将看不到它们。另一件让我有点困惑的事情是我将同一库的另一个版本安装为常规文件夹。然而该文件夹中没有 __init__.py 。
The problem was that I installed the library from an egg. Egg folders need to be added manually or otherwise PyDev won't see them. Another thing that confused me a little was that I had another version of the same library installed as a regular folder. That folder however didn't have
__init__.py
in it.