I am having the below error after a clean installation of python via brew install python. The link belongs to a previous python installation which I deleted manually.
$ virtualenv ENV
python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No such file or directory
I am using MacOS 10.7.3 and I installed virtualenv via pip:
$ sudo /usr/local/share/python/pip install virtualenv
Downloading/unpacking virtualenv
Downloading virtualenv-1.7.1.2.tar.gz (2.1Mb): 2.1Mb downloaded
Running setup.py egg_info for package virtualenv
warning: no previously-included files matching '*.*' found under directory 'docs/_templates'
Installing collected packages: virtualenv
Running setup.py install for virtualenv
warning: no previously-included files matching '*.*' found under directory 'docs/_templates'
Installing virtualenv script to /usr/local/share/python
Successfully installed virtualenv
Cleaning up...
$ virtualenv ENV
python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No such file or directory
How can I fix this?
Edit : I reinstalled MacOSx and now returned back to my previous status that made me delete the preinstalled python.
$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
$ which pip /usr/local/bin/pip $ sudo pip install virtualenv
Downloading/unpacking virtualenv
Downloading virtualenv-1.7.1.2.tar.gz (2.1Mb): 2.1Mb downloaded
Running setup.py egg_info for package virtualenv
warning: no previously-included files matching '*.*' found under directory 'docs/_templates'
Installing collected packages: virtualenv
Running setup.py install for virtualenv
warning: no previously-included files matching '*.*' found under directory 'docs/_templates'
Installing virtualenv script to /usr/local/bin
Successfully installed virtualenv
Cleaning up...
$ python virtualenv.py ENV
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/??MacOS/Python: can't open file 'virtualenv.py': [Errno 2] No such file or directory
The virtualenv.py is located at /Library/Python/2.7/site-packages/virtualenv.py and /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/py2app/recipes/virtualenv.py but somehow python misses all.
Why there is so much mess? How should I proceed to fix this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…