Somehow I screwed up my python 2.7 installation on my mac so I tried to reinstall with "brew install python". Now when I try to create a new virtualenv, it throws an error about not finding /bin/easy_install. easy_install is actually in /usr/local/bin/easy_install. If I symlink it to /bin, virtualenv fails with /bin/pip and so on - every file it's looking for is actually in /usr/local/bin not /bin
How can I permanently make virtualenv look in the right place: /usr/local/bin?
$ virtualenv env
New python executable in /Users/myusername/code/lambda/env/bin/python2.7
Also creating executable in /Users/myusername/code/lambda/env/bin/python
Installing setuptools, pip, wheel...
Complete output from command /Users/myusername/c...da/env/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
Collecting pip
Collecting wheel
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_set.py", line 646, in install
**kwargs
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/wheel.py", line 465, in move_wheel_files
generated.extend(maker.make(spec))
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 353, in make
self._make_script(entry, filenames, options=options)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 257, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 231, in _write_script
self._fileop.write_binary_file(outname, script_bytes)
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/_vendor/distlib/util.py", line 388, in write_binary_file
with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/bin/easy_install'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==13.2.0.dev0', 'console_scripts', 'virtualenv')()
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 699, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 872, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 837, in install_wheel
'PIP_USER': '0'
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 777, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/myusername/c...da/env/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 2
About halfway down that output you can see virtualenv looking for /bin/easy_install
$ ls -al /bin/easy_install
ls: /bin/easy_install: No such file or directory
$ ls -al /usr/local/bin/easy_install
lrwxr-xr-x 1 myusername admin 40 Dec 22 14:21 /usr/local/bin/easy_install -> ../Cellar/python/2.7.11/bin/easy_install
But it should be looking in /usr/local/bin instead because that's the only easy_install I have now and it works:
$ which easy_install
/usr/local/bin/easy_install
$ easy_install
install_dir /usr/local/lib/python2.7/site-packages/
error: No urls, filenames, or requirements specified (see --help)
I've tried to pip uninstall virtualenv then pip install virtualenv but that didn't help - same issue.
Anyone know how to fix this?
Thanks!
====================
EDIT: Solved! Tried using /usr/local/bin/virtualenv-2.7 and it worked as expected. I moved /usr/local/bin/virtualenv then symlinked /usr/local/bin/virtualenv-2.7 back to /usr/local/bin/virtualenv --- now all appears to be well in the world.
Solved! Tried using /usr/local/bin/virtualenv-2.7 and it worked as expected. I moved /usr/local/bin/virtualenv then symlinked /usr/local/bin/virtualenv-2.7 back to /usr/local/bin/virtualenv --- now all appears to be well in the world.