pydev安装后找不到python库
我正在使用 Django 和 PyDev/Eclipse。我刚刚使用 setup.py install 安装了 django-treebeard,它安装在我的 site-packages 目录 C:\Python26\Lib\site-packages 中。我可以使用 import treebeard
在 python shell 中成功导入它。然而,PyDev 抱怨当我尝试导入它时它无法解决它。
不幸的是,我没有使用 PyDev 的经验,我认为它会自动获取 site-packages 目录中的所有内容,但显然它不会。我缺少什么?
谢谢
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install
and it got installed in my site-packages directory C:\Python26\Lib\site-packages
. I can successfully import it in the python shell with import treebeard
. However PyDev complains that it cannot resolve it when I try to import it.
Unfortunately I have no experience with PyDev and I assumed that it would automatically pick up everything in the site-packages directory but apparently it does not. What am I missing?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Pydev 不会自动重新扫描 site-packages 文件夹。您需要转到
Preferences->;口译员-> Python
并单击“应用”使其再次扫描。Pydev doesn't automatically rescan the site-packages folder. You need to go to
Preferences-> Interpreter -> Python
and click apply to make it scan again.当我安装新包时,我也遇到了同样的错误。我正在使用 eclipse Helios。
即使在应用并重新扫描文件夹后,它也没有检测到新的软件包。所以最后我单击列出的“单击此处配置未列出的解释器”并删除已选择的解释器并使用自动配置再次添加解释器。
最后我能够解决这个问题。
I also faced the same error when i had installed a new package.i'm using eclipse Helios.
Even after applying and re scanning the folder it was NOT detecting the new packages. So finally i clicked on the "Click here to configure a interpreter not listed" listed and deleted the already selected interpreter and used the autoconfig to add the interpreter again.
Finally i was able to resolve the issue.
我发现关闭项目并重新打开(重新扫描解释器后)对我有用。
I've found that closing the project and reopening (after rescanning the interpreter) works for me.
好吧,我按照以下顺序使其工作:
1)我使用 pip install 安装了所需的库
2) 我在 Eclipse 中进入: Window -->偏好设置 -->派德夫 -->口译员 --> Python解释器,然后单击“快速自动配置”。它成功了。
Well, I followed this sequence to make it work:
1) I installed the desired library by using pip install
2) I went in Eclipse to: Window --> Preferences --> Pydev --> Interpreters --> Python Interpreter, and clicked "Quick Auto-Config". It made the trick.