4

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.

James Henstridge
44.2k9 gold badges139 silver badges119 bronze badges
asked Mar 2, 2013 at 4:53
1
  • How did you delete it? Also can you go to /usr/bin/ and do ls -all | grep python and show us what it has? Commented Mar 2, 2013 at 5:19

1 Answer 1

4

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
answered Mar 2, 2013 at 6:30
Sign up to request clarification or add additional context in comments.

2 Comments

Adding this export to the path helped the system recognize Django again. Now I could for example do django-admin.py and it works. Thank ou...
how can even not remember what i have done cause i bought second laptop

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.