0
爲什麼直接調用我的腳本時導入psyco會工作,但是當我從bash腳本調用它時會失敗???Python 2.6在Ubuntu上導入軟件包(psyco)
test.sh:
while true
do
python test.py;
sleep 10;
done
test.py: 「得了Psyco的」
try:
import psyco
print "Got psyco!"
except ImportError:
print "No psyco."
而現在......
> python test.py
> ./test.sh
「沒有psyco」。
「沒有psyco」。
...
那麼運行它時你在不同的目錄中。 – enginefree 2013-03-24 21:56:57