I installed python with brew install python
which pip
/usr/local/bin/pip
my PYTHONPATH
shows /usr/local/lib/python2.7/site-packages/
However, when I try to install something with pip, it goes to the /bin/
directory as shown below. I want things installed to /usr/local/lib/python2.7/site-packages/
. How do I fix this?
pip install virtualenv
Downloading/unpacking virtualenv
Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Installing collected packages: virtualenv
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
{....}
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/distlib/util.py", line 384, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/bin/virtualenv'
$ pip list
pip (1.5.6)
setuptools (5.4.2)
wsgiref (0.1.2)
$pip show setuptools
---
Name: setuptools
Version: 5.4.2
Location: /usr/local/lib/python2.7/site-packages/setuptools-5.4.2-py2.7.egg
Requires:
So pip already has the basic packages installed to site-packages. However, running the same exact pip to install virtualenv tries to install to /bin/.