2

我在 Mac OS Lion 上使用 macports 安装了 python 2.7.3,并使用了port select python python27. 但是 python 版本仍然显示 2.7.1 (虽然which python显示了正确的 macport 安装目录 ie /opt/local/bin/python)。此外,这导致python不再识别os.urandom

>>> import os
>>> os.urandom
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'urandom'

任何想法为什么会发生这种情况?以及如何解决?

4

0 回答 0