使用OS X Lion breaks上的macports将python从2.7.1升级到2.7.3os.urandom公司

2024-10-02 08:27:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我在macoslion上使用macports安装了python2.7.3,并使用了port select python python27。但是python版本仍然显示2.7.1(尽管which python显示了正确的macport安装目录,即/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'

为什么会有这样的想法?怎么解决呢?在


Tags: 版本目录whichbinosportlocalselect

热门问题