Python asks for older paths on mac after deleting duplicate python installation
macos, python, python-2.7, virtualenv
Solution
I had the very same situation after done stupid thing of deleting whole `/System/Library/Frameworks/Python.framework/` what results in error:
`python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No such file or directory`
I managed to restore it, because I had a earlier copy of my whole disk, and just by copy-pasting the whole Python.framework directory back.
I don't know how much it is system dependent, but if somebody would like to try do that the same way instead of reinstalling whole OS X, the whole Python.framework zipped from me is here: http://andilabs.com/Python.framework.zip
Problem
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?