小编Neo*_*s86的帖子

Crontab 使用错误版本的 Python 来运行脚本

crontab 使用 2.6 版来运行需要 2.7 版才能运行的脚本。如何将 Python 的默认版本永久设置为 2.7?运行 ./file.py 工作正常,就在它通过 crontab 运行时

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR …
Run Code Online (Sandbox Code Playgroud)

python crontab python-2.7

7
推荐指数
1
解决办法
4988
查看次数

标签 统计

crontab ×1

python ×1

python-2.7 ×1