python - 指定 Automator 中运行哪个版本的 Python?

标签 python macos updates automator

在我的终端和 CodeRunner 中,我的 Python 已更新到 2.7.6,但是当我在 OSX Automator 中运行 shell 脚本时,我发现它正在运行 2.7.2

如何像其他编译器一样将 Automator Python 更新到 2.7.6?

最佳答案

我无法明确指定它使用哪个Python。 因此,我使用以下命令在 bash 环境中运行它:

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

并确保 python 程序的第一行包含您要使用的 python 环境的路径。 例如:

#!/usr/local/bin/python

关于python - 指定 Automator 中运行哪个版本的 Python?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20505085/

相关文章:

macos - Home/end 控制字符在 Mac OS X 终端下的 emacs 中不起作用

macos - 在 OS X 上设置 g++

mysql - Gitlab从源码更新到打包版本

javascript - d3.min.js Uncaught TypeError : a. 映射不是函数

我无法理解的 Python 行为

python - 0-lag 时的标准化 plt.xcorr 和 np.corrcoef 之间的差异

python - 在python中找到最相似的句子

macos - "⌅"符号是什么意思?

wordpress - 更新容器内的 WordPress。没有 FTP 访问权限

angular - AppModule 的 NgModule.imports 中位置 5 的值不是引用(构建错误 Angular2)