指定在Automator中运行哪个版本的Python? [英] Specify which version of Python runs in Automator?
问题描述
在我的终端和CodeRunner中,我的Python更新为2.7.6,但是当我在OSX Automator中运行shell脚本时,我发现它正在运行2.7.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
如何像其他编译器一样将Automator Python更新到2.7.6?
How can I update the Automator Python to 2.7.6 like the rest of my compilers ?
推荐答案
我无法明确指定要使用哪个python.因此,我使用以下命令在 bash
环境中运行了它:
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
并确保python程序的第一行包含您要使用的python环境的路径.例如:
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
这篇关于指定在Automator中运行哪个版本的Python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!