我正在使用 python 2.6 并尝试安装 django 标记包,我在下面收到此错误。我在已经有 python2.6 的 64 位机器上安装了几个 python 2.4 包。
如何解决此错误
[root@tom django-tagging-0.3.1]# python setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from distutils.command.install import INSTALL_SCHEMES
File "/usr/lib64/python2.6/distutils/command/install.py", line 21, in <module>
from site import USER_BASE
ImportError: cannot import name USER_BASE
EDIT 1
[root@tom django-tagging-0.3.1]# python2.6 setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from distutils.command.install import INSTALL_SCHEMES
File "/usr/lib64/python2.6/distutils/command/install.py", line 21, in <module>
from site import USER_BASE
ImportError: cannot import name USER_BASE
EDIT2
>>> from distutils.sysconfig import get_python_lib
>>> print(get_python_lib())
/usr/lib/python2.6/site-packages
EDIT3
>>> import site ; print site
<module 'site' from '/opt/mysite/site/__init__.pyc'>