如何防止setup.py使用系统包

时间:2018-01-31 15:27:01

标签: python python-2.7 setup.py

我正在使用setup.py脚本将python包安装到虚拟环境中。但是,此软件包的某些依赖项可在/opt/common/CentOS_6-dev/python/python-2.7.10/lib/python2.7/site-packages文件夹中找到,我希望将这些依赖项重新安装到我的虚拟环境位置~/virtualenv/lib/python2.7/site-packages)

我的$ PATH中没有列出/opt/common路径,而我的$ PYTHONPATH只列出了一条路径/home/johnsoni/virtualenv/lib/python2.7/site-packages

我不确定为什么在尝试使用python setup.py安装时会导入和使用这些系统包

Using /opt/common/CentOS_6-dev/python/python-2.7.10/lib/python2.7/site-packages
Searching for PyYAML==3.12
Best match: PyYAML 3.12
PyYAML 3.12 is already the active version in easy-install.pth

Using /opt/common/CentOS_6-dev/python/python-2.7.10/lib/python2.7/site-packages
Searching for idna==2.6
Best match: idna 2.6
Removing idna 2.5 from easy-install.pth file
Adding idna 2.6 to easy-install.pth file

Using /home/johnsoni/virtualenv/lib/python2.7/site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect script to /home/johnsoni/virtualenv/bin

0 个答案:

没有答案