With Python 3.7 on OS X I set up a virtual environment then
$ source venv/bin/activate
$ pip install numpy
$ which pip
pip is /Users/me/PycharmProjects/Test1/venv/bin/pip
(venv)
But rather than installing in the virtual environment numpy
is installed in
/usr/local/lib/python2.7
and numpy
doesn't appear in pip list
The issue occurs with both Python installed via the Python download or via brew
.
What possible settings could be causing the package to be installed in the wrong location.
To answer my own question.
There was an invisible
~/.config/pip/pip.conf
file. That contained these lines:
[global]
target = /usr/local/lib/python2.7/site-packages
This file was a few years old, so I'm unsure how it got there but removing it resolved the issue.
What worked for me :
[global]
target=D:\Dropbox\online store\django\ve\lib\site-packages
3)after restarting venv, by using this command
python -m pip install <package name>
now I am able to install packages on my venv ( instead of being installed globally )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With