Mac OS X Lion上的python“ImportError:无法导入名称urandom”

时间:2013-02-13 10:26:29

标签: python macos

自从我上次使用macport更新了python(nonw 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 version 2.7.3
  • $ PATH:/ opt / local / bin:/ opt / local / sbin:/ usr / bin:/ bin:/ usr / sbin:/ sbin:/ usr / local / bin:/ usr / X11 / bin < / LI>
你能帮帮我吗?谢谢

1 个答案:

答案 0 :(得分:0)

尝试更新Xcode命令行工具。