Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting this error from the Unix Z shell (I'm on Mac):

python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: No such file or directory

What am I doing? I'm just running a software in which I put my executable python script. My script is working without any issue, I can also run it from the shell by itself and still works.

I have to mention I'm using Python 2.7, even when I launch Python from the shell it starts with Python 2.7 and not the Version2.6. I actually tried to remove Python 2.6 from the Frameworks but again the same error.

Putting python2.7 sreloc.py as a line (instead of just sreloc.py) for example (this is a piece of the big code where my script lies):

   python2.7 sreloc.py
   cp $ttim $mtrav

the error I'm getting is:

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'sreloc.py': [Errno 2] No such file or directory

I'm really interested in solving this last problem, or anyway being able to run sreloc.py as a part of the main code, but any idea about the first one would be appreciated.

share|improve this question

migrated from stackoverflow.com Nov 11 '11 at 3:13

This question came from our site for professional and enthusiast programmers.

How did you install Python 2.7? I suspect a broken installation, but don't have enough OSX experience to recognize the problem. Is sreloc.py in the current directory or on the PATH? What is the first line of sreloc.py? What exactly did you do to get the first error? – Gilles Nov 11 '11 at 1:25
I use Python from MacPorts because it's more easy to support it. Python 2.4, 2.5 and 2.6 are from base, so I don't recommend to touch them like remove. Also you can try to play with your PATH environment. Ah, don't forget do port select after installing Python from MacPorts. – Eir Nym Nov 19 '11 at 15:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.