简体   繁体   English

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

[英]python on Mac OS X Lion “ImportError: cannot import name urandom”

Since I last updated python (nonw 2.7.3) using macport, I got the following issue: 自从我上次使用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

I am running on: 我正在运行:

  • OS X version 10.7.5 OS X版本10.7.5
  • python version 2.7.3 python版本2.7.3
  • $PATH: /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin $ PATH:/ opt / local / bin:/ opt / local / sbin:/ usr / bin:/ bin:/ usr / sbin:/ sbin:/ usr / local / bin:/ usr / X11 / bin

Can you please help me out ? 你能帮我吗? Thanks 谢谢

尝试更新您的Xcode命令行工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM