3

I'm facing a problem with Package Installation, pip. I am using Python 3.6.

When I try to install a package with pip I receive the following message in the cmd.

*C:\Python36\Scripts>pip intstall --user httpie
Traceback (most recent call last):
  File "c:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python36\Scripts\pip.exe\__main__.py", line 5, in <module>
ImportError: cannot import name 'main'*

It happened when I upgraded the pip, before it worked. I tried to uninstal the Python and installed this again but it does not work. I cannot find the solution, any ideas?

Jacob Fuchs
  • 359
  • 1
  • 3
  • 14
  • Possible duplicate of [ImportError: cannot import name main when running pip --version command in windows7 32 bit](https://stackoverflow.com/questions/28210269/importerror-cannot-import-name-main-when-running-pip-version-command-in-windo) – phd Apr 22 '18 at 23:58

3 Answers3

1

You can also downgrade to pip 9.x using

python -m pip install -U "pip<10"
Nils Werner
  • 34,832
  • 7
  • 76
  • 98
0

Firstly if you have installed pip then remove it by deleting the folder of pip inside python directory. Then install pip by this command:

$ sudo easy_install pip

This will install older version, you can download newer version after 10th when it will come.

Vicrobot
  • 3,795
  • 1
  • 17
  • 31
0

I fixed it. I deleted the folder with pip as you said. Because I work in Windows 10, I downloaded the get-pip.py from https://pip.pypa.io/en/stable/installing/ and I run it.

Jacob Fuchs
  • 359
  • 1
  • 3
  • 14