-1

I am getting the following error message when installing some libraries on PyCharm:

Command "python setup.py egg_info" failed with error code 1 in C:\Users\user.name\AppData\Local\Temp\pycharm-packaging\hachoir-metadata\ You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Path to pip3.5.exe:

C:\Users\user.name>AppData\Local\Programs\Python\Python35-32\Scripts\pip3.5.exe

I have run the following from cmd:

C:\Users\user.name>AppData\Local\Programs\Python\Python35-32\Scripts\pip3.5.exe install upgrade pip

Which gives me the following:

Could not find a version that satisfies the requirement upgrade (from versions: ) No matching distribution found for upgrade You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

I then tried both:

C:\Users\user.name>AppData\Local\Programs\Python\Python35-32\Scripts\pip.exe pip install upgrade pip

and:

C:\Users\user.name>AppData\Local\Programs\Python\Python35-32\Scripts\pip.exe python -m pip install --upgrade pip

From pip.exe (rather than pip3.5exe as they didn't work on that) which resulted in:

ERROR: unknown command

I am pretty sure that I am doing something wrong here, but not quite sure what?

Tried the following:
C:\Users\user.name>\AppData\Local\Programs-m pip install --upgrade pip

C:\Users\user.name>\AppData\Local\Programs\Python\Python35-32\Scripts\pip.exe -m pip install --upgrade pip
C:\Users\user.name>\AppData\Local\Programs\Python -m pip install --upgrade pip
Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Maverick
  • 789
  • 4
  • 24
  • 45
  • are you sure about the python path, is it install here ? `C:\Users\user.name>AppData\Local\Programs\Python\Python35-32` – Surajano Apr 05 '17 at 09:19
  • Not sure if it also happens with Windows, but in Ubuntu pip version has been patched to 8.1.2 to prevent self-upgrades, so even if version 9 exist it will not upgrade. http://stackoverflow.com/questions/41674368/pip-refuses-to-upgrade –  Apr 05 '17 at 09:27
  • @Surajano, yes this is where it is installed – Maverick Apr 05 '17 at 09:36

1 Answers1

6

Use python -m pip install --upgrade pip as the command, not as an argument to pip.exe. This will call python.exe with -m pip install --upgrade pip as arguments.

Also make sure you are running this from a command prompt with admin rights.

Christian König
  • 3,437
  • 16
  • 28
  • Thinks for this, I did try it but still no luck - see update for what I tried. Would you mind specifying the full path of what you think it would be? Sorry to be a pain, but this would help me see where I'm going wrong. – Maverick Apr 05 '17 at 09:43
  • 2
    @Maverick, if python.exe isn't in `PATH`, then you could use `py -3.5-32 -m pip install --upgrade pip`. Remember the two dashes in front of "upgrade"; a couple of your attempts in the question forgot this. If `py.exe` also isn't found, then use the absolute path to your interpreter: `"%LocalAppdata%\Programs\Python\Python35-32\python.exe" -m pip install --upgrade pip`. Note what the `-m` option is doing; it imports and runs `pip` as the `__main__` module. You can't use the pip.exe script wrapper for this because upgrading has to replace it. – Eryk Sun Apr 05 '17 at 15:41
  • 2
    Christian, the OP doesn't need admin rights in this case. That's the main selling point for defaulting to a per-user install. – Eryk Sun Apr 05 '17 at 15:53
  • Thanks for the clarification, @eryksun - the accepted answer belongs to you. – Christian König Apr 05 '17 at 18:56