在Mac OS X Lion上使用Python时“ImportError: cannot import name urandom”
自从我通过macport更新了python(现在是2.7.3版本)后,我遇到了以下问题:
Traceback (most recent call last): File "", line 4, in File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py", line 46,
in import email.utils File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/utils.py", line 27,
in import random File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 47,
in from os import urandom as _urandom
ImportError: cannot import name urandom
我正在使用的系统信息是:
- 操作系统版本:OS X 10.7.5
- python版本:2.7.3
- 系统路径:$PATH: /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
你能帮我一下吗?谢谢!
1 个回答
0
试着更新一下你的Xcode命令行工具。