Reputation: 33303
I had two version of python.. python 2.6 and python 2.7
I just now deleted python 2.6 (rather in very unsafe way)..
Now when I type python, I get this error:
python: VERSIONER_PYTHON_VERSION environment variable error (ignored)
python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: No such file or directory
My python 2.7 is installed in
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
When i do which python
I get /usr/bin/python
How do i resolve this mess I have created.
Upvotes: 4
Views: 3329
Reputation: 85125
Looks like you deleted the Apple-supplied Python 2.6. You shouldn't have done that. Never delete files in /usr
, other than /usr/local
, or in /System/Library
. When you install another framework version of Python, like you did with the Python 2.7 into /Library/Frameworks
, the way to manage which one you use is by managing your shell PATH
environment variable, not by attempting to modify /usr/bin/python
. You have three primary options now: (1) live without the Apple-supplied Python 2.6 until your next OS X upgrade and hope that no other Apple-supplied utilities you need depend on it; or (2) reinstall all of OS X; or (3) if you remember exactly what you deleted and have a full backup, attempt to restore the deleted files. To use the newer Python 2.7, put it first on your path, for example:
export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
Upvotes: 4