擅长:python、mysql、java
<p>我认为这是您的cwd(当前工作目录)有问题。一种简单的测试方法是转到根目录(cd/),然后运行:</p>
<pre><code>python2.7 /home/nezap/webapps/bonzer/bonzer/apps/base/alert.py
</code></pre>
<p>你应该得到同样的错误。要使用的路径将取决于通常运行脚本的位置。我想要么是:</p>
<p>/home/nezap/webapps/bonzer/bonzer/apps/base</p>
<p>或者</p>
<p>/home/nezap/webapps/bonzer/bonzer/</p>
<p>所以你的解决方案要么是:</p>
^{pr2}$
<p>或者</p>
^{3}$
<p>基本上,您是在告诉cron将目录更改为该路径,然后如果该路径有效(则运行以下命令)。在</p>