脚本在执行时,突然报如下错误(声明:在十分几分钟前运行是正常的):
File "/home/yusulian/ysltest/mail.py", line 6, in <module>
import smtplib
File "/usr/local/lib/python2.5/smtplib.py", line 49, in <module>
from email.base64MIME import encode as encode_base64
ImportError: cannot import name encode
疑惑:有点莫名其妙,没变动python的环境。
结果:实在是没有头绪,直接跑到运行的工作目录,把相关*.pyc文件给删出,然后在重新运行一下,竟然正常了。
--
Elian
Configuration Manage Engineer
MSN: smallfish961@hotmail.com
Email: smallfish382+work@gmail.com
No comments:
Post a Comment