在 Eclipse 中刷新 PyDev 导入路径

发布于 2024-11-02 06:13:15 字数 269 浏览 9 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会发光的星星闪亮亮i 2024-11-09 06:13:15

问题是我从一个鸡蛋安装了这个库。 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文