【发布时间】:2015-04-27 06:09:55
【问题描述】:
我想检查在我的虚拟环境下运行的是哪个 Python 解释器,所以我只是进入了虚拟环境并使用了 getsitepackages。就这样出来了。
(test)~/Documents/Development/test$ python
Python 2.7.9 (default, Apr 7 2015, 07:58:25)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>> print site.getsitepackages()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getsitepackages'
>>>
在 virtualenv 下操作时这是正常行为吗?如果可能的话,我将如何纠正,或者我什至应该打扰?
【问题讨论】:
标签: python terminal virtualenv