2

In my terminal and in CodeRunner my Python is updated to 2.7.6 but when I ran a shell script in the OSX Automator I found that it is running 2.7.2

How can I update the Automator Python to 2.7.6 like the rest of my compilers ?

2
  • Are you by chance using #!/usr/bin/python in your Automator script? That will run the system Python, which is 2.7.2 for Mt Lion. You need to point it to the correct location of your 2.7.6 binary Commented Dec 10, 2013 at 21:07
  • 1
    Instead of #!/usr/bin/python, put #!/path/to/2/7/6/python - if you're using the Python.org installation, it's likely /Library/Frameworks/Python.framework/Versions/2.7/bin/python or something along those lines. You'll need to determine exactly what it is for your system. If you can run python from the command line and get the right version, enter which python and it'll give you the path. Commented Dec 11, 2013 at 2:21

1 Answer 1

3

I couldn't specify explicitly which python for it to use. So, I ran it in bash environment with following command:

$ your/python/path /path/to/your/python/script.py

And make sure first line of your python program contains the path to the python environment you wish to use. Eg:

#! /usr/local/bin/python

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.