无法使用下载的软件包

时间:2020-06-03 17:58:53

标签: python package installation

我从cmd下载了pip和一系列其他软件包,但是当我想在Eclipse中使用它们时,它们不会导入。

我已经检查了他们是否有点子清单。

1 个答案:

答案 0 :(得分:0)

您需要配置Eclipse以在python安装的site-packages文件夹中查找已安装的软件包。

Site-packages是手动构建的Python软件包的目标目录。当从源代码构建和安装Python软件包时(使用distutils,可能通过执行python setup.py install),默认情况下,您会在站点软件包中找到已安装的模块。

您可以按照以下步骤在Eclipse中添加它:

1. Find out the path to the folder ../site-packages/ of your corresponding python version. ( e.g /usr/local/lib/python3.6/site-package for python3.6 on Ubuntu )
2. Open eclipse preferences and go to PyDev -> Interpreter - Python.
3. On the left side of the lower box, click on New Folder.
4. Add the navigate to ../site-packages/ of your corresponding python version.
5. Hit Open.
6. Hit Apply.
7. Hit Ok.