我一直在尝试为python 2.7导入pip,但似乎我缺少解析模块。我已经安装了easy_install,我正在尝试使用pip安装noise-1.1.1。但是pip不想安装。
这就是它的样子。
c:\Python27>python setup.py install
Traceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup
File "c:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\__i
nit__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "c:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\ext
ension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "c:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\dis
t.py", line 6, in <module>
from setuptools.command.install import install
File "c:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\com
mand\__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "c:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\setuptools\com
mand\install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "c:\Python27\lib\site-packages\distribute-0.6.35-py2.7.egg\pkg_resources.
py", line 17, in <module>
from urllib.parse import urlparse, urlunparse
ImportError: No module named parse
答案 0 :(得分:6)
您的distribute
安装不正确;由于某种原因,python 2to3转换已在其上运行(只有在使用Python 3安装时才会自动发生)。
urllib.parse
库是Python 3中用于Python 2的urlparse
库的等价物。
您最好的办法是删除错误安装的版本(按照uninstallation instructions进行操作),然后再运行distribute_setup.py
script。