0

I'm using a setup.py script to install a python package into a virtual environment. However some of the dependencies of this package are being found in a folder /opt/common/CentOS_6-dev/python/python-2.7.10/lib/python2.7/site-packages and I would like instead for these to be reinstalled into my virtual environment location (~/virtualenv/lib/python2.7/site-packages).

My $PATH does not have the /opt/common path listed in it, and my $PYTHONPATH only has one path, /home/johnsoni/virtualenv/lib/python2.7/site-packages listed.

I'm not sure why these system packages are being imported and used when trying to install with 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
ionox0
  • 1,101
  • 2
  • 14
  • 21
  • old question, you probably figured out a solution. Did you create your virtualenv with `--no-site-packages`? Did you enable your virtualenv with `source bin/activate`? – m-ric Jun 24 '18 at 02:01
  • 1
    recently I haven't been having this problem, and I believe the solution was to unset the `PYTHONPATH` variable that was referencing the system site packages. https://stackoverflow.com/questions/1382925/virtualenv-no-site-packages-and-pip-still-finding-global-packages – ionox0 Jun 25 '18 at 20:27

0 Answers0