june
june

Reputation: 39

error with python launcher unable to find the correct interpreter

I'm running python 3.3 on mac, and whenever I run a .py file in the terminal window with the command:

cd '/Users/Jacob/Desktop/' 
&& '/usr/bin/env pythonw'  '/Users/Jacob/Desktop/PygLatin.py'
&& echo Exit status: $? && exit 1

I get the following error:

bash: /usr/bin/env pythonw: No such file or directory

I've tried using

#!/usr/bin/env pythonw

on the first line because that was the interpreter that Python launcher had in preferences. It seems like Python launcher is trying to open

cd '' && '/sw/bin/pythonw'  '<your script here>'  && echo Exit status: $? && exit 1

as the interpreter. How can I fix this error?

Upvotes: 0

Views: 2184

Answers (3)

Rick
Rick

Reputation: 1

You can change the interpreter by typing it directly into the INTERPRETER field => The one with the dropdown, but DON'T use the dropdown - TYPE in the path and interpreter)

(Sorry for so many edit - I'm new to this)

On my osx 10.8.5 On my osx 10.8.5 - /usr/bin/pythonw is a 2.7 interpreter - /usr/local/bin/pythonw doesn't exist - /usr/local/bin/pythonw3 (and several other) python 3 interpreters are available (I'm using pythonw3.3-32) - /sw/bin/pythonw - I don't think it exists

Upvotes: 0

Daniel Roseman
Daniel Roseman

Reputation: 600041

By putting '/usr/bin/env pythonw' inside a single quote, you are telling the shell that this is a single filename, with a space in. That's why you're getting the 'No such file' error.

You should use just /usr/bin/env pythonw without the quotes.

Upvotes: 1

user2582048
user2582048

Reputation:

I suppose you are trying to run the file in a wrong way. You can just open the terminal and type cd [/Your directory here] and then python yourfile.py It will search for the interpreter on its own. No need to specify its location(explicitly).

Upvotes: 0

Related Questions