当我从我的主目录进入python环境并尝试import smtplib
时,我收到以下错误:
>>> import smtplib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/space/jazz/1/users/gwarner/anaconda/lib/python2.7/smtplib.py", line 46, in <module>
import email.utils
File "email.py", line 3, in <module>
from email.mime.text import MIMEText
ImportError: No module named mime.text
我的主目录的which python
为/space/jazz/1/users/gwarner/anaconda/bin/python
。奇怪的是,我可以从/space/jazz/1/users/gwarner/anaconda/lib/python2.7
成功导入smtplib,即使我的which python
与我的主目录中的which python
相同。如果我的路径/ {{1}}没有变化,我怎么能在前者而不是在后者中出错?