我有一个在 Python Shell 中运行良好的脚本,但是当双击时它无法导入 PIL 模块(但它确实在 Shell 中导入了 PIL 模块)。
怎么了?我需要一个不同的shebang吗?我在 Windows 7 上:
#!/usr/bin/env python
"""
"""
try:
from PIL import Image
import os
import datetime
import time
except Exception, e:
raw_input(str(e))
# Running this script in the Shell, the code gets to here
# Running this script in real life (just double click it) it prints "no module PIL"