gpt4 book ai didi

python - Eclipse Pydev : 'Error: Python stdlib not found'

转载 作者:IT老高 更新时间:2023-10-28 22:22:38 26 4
gpt4 key购买 nike

我正在尝试将解释器(使用 virtualenv 创建)添加到 PyDev,但出现以下错误:

It seems that the Python /Lib folder (which contains the standard library) was not found /selected during the instal process.

This folder (which contains files such as threading.py and traceback.py) is required for PyDev to function properly (and it must contain the actual source files, not only .pyc files) ...

Note that if this is a virtualenv install, the /Lib folder from the base install needs to be selected (unlike the site-packages which is optional)...

问题是我的默认安装下没有/lib 文件夹...我使用“no-site-packages”选项创建了 virtualenv...我该如何解决?谢谢!

最佳答案

我自己以前也遇到过。在 PyDev 中添加使用 virtualenv 创建的解释器时,当它询问需要添加到 SYSTEM pythonpath 的文件夹时,我必须选择
/usr/lib/python2.7
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/plat-linux2
请参阅屏幕截图以了解我必须做的事情。这里 temp 是我的 virtualenv。

enter image description here

虽然添加了系统 Python 目录,但 PyDev 并没有拾取全局站点包,所以仍然可以实现“无站点包”的效果。我假设您必须在 Windows 上执行类似的操作,即在“Select Needed”对话框中选择所有文件夹,包括 C:\Pythonx.x 文件夹。

编辑:我刚刚在 Eclipse Indigo(带有 virtualenv 1.7 的 Arch Linux)上使用 PyDev 2.3 进行了尝试,似乎不需要 plat-linux2已选择(不确定 lib-tk,但肯定需要 /usr/lib/python2.7)。感谢 fijiaaron 指出。

EDIT 2:Pydev 2.5(也可能是 2.6,from the docs)仍然需要 /Lib 文件夹才能正常运行,尽管它现在允许您忽略“Python stdlib not found”对话框并添加解释器(但提到它仍然需要稍后包含)。

关于python - Eclipse Pydev : 'Error: Python stdlib not found' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6615629/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com