Can't install pip due to "ImportError: No module named parse"

18,336

Your distribute installation is incorrect; for some reason the python 2to3 translation has been run on it (which only should happend automatically when installing with Python 3).

The urllib.parse library is the Python 3 equivalent of the urlparse library used in Python 2.

Your best bet is to remove the mis-installed version (follow the uninstallation instructions) then run the distribute_setup.py script instead.

Share:
18,336
NothingToSay
Author by

NothingToSay

Updated on June 05, 2022

Comments

  • NothingToSay
    NothingToSay almost 2 years

    I've been trying to import pip for python 2.7 but it seems that I'm missing parse module. I already have installed easy_install, and I'm trying to install noise-1.1.1 using pip. But pip doesn't want to be installed.

    This is what it looks like.

    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
    
  • NothingToSay
    NothingToSay about 11 years
    That worked, must have had some weird bug or something when I installed it, thanks. This works!