0

I'm trying to upgrade python's pip from version 19.3.1 to 20.0.2. Python is on version 3.8 When I enter "python -m pip install --upgrade pip" to update pip all I get is the error message:

"ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 153, in _main
    status = self.run(options, args)
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 446, in run
    installed = install_given_reqs(
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\__init__.py", line 58, in install_given_reqs
    requirement.install(
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_install.py", line 858, in install
    self.move_wheel_files(
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_install.py", line 487, in move_wheel_files
    wheel.move_wheel_files(
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_internal\wheel.py", line 594, in move_wheel_files
    generated_console_scripts = maker.make_multiple(scripts_to_generate)
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 402, in make_multiple
    filenames.extend(self.make(specification, options))
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_internal\wheel.py", line 330, in make
    return super(PipScriptMaker, self).make(specification, options)
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 391, in make
    self._make_script(entry, filenames, options=options)
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 295, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 231, in _write_script
    launcher = self._get_launcher('t')
  File "C:\Users\43898\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 370, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command."

I've tried manually updating pip, reinstalling to the newest version of python 3.8.2, uninstalling python then installing again. With no success. Pip also isn't installing new packages either. I hope I have included enough to solve my problem.

  • Try: `python -m pip install -U pip` – Alex Susanu Apr 18 '20 at 08:21
  • Python wasn't recognised as a command but when i changed i to py it came up with the same error @AlexSusanu – Campbell Skene Apr 18 '20 at 08:26
  • `python` not being recognised as a command suggests something wrong with your `python` installation. Have you tried running a simple code or reinstalling `python`? – Cibin Joseph Apr 18 '20 at 08:35
  • Can you do a `where python` and `where pip` – Alex Susanu Apr 18 '20 at 08:36
  • If i type "py" into cmd it runs python so its working somehow? @CibinJoseph – Campbell Skene Apr 18 '20 at 08:39
  • The `py` command is a wrapper to select any of the python versions. It is always better to explicitly specify which version you'd like to run the program with; by using `py -2` or `python3` or so on. Take a look at the documentation or https://stackoverflow.com/questions/32742093/how-to-access-python-from-command-line-using-py-instead-of-python to see how `py` works. And finally, ensure you have pip installed for that *same* python version. – Cibin Joseph Apr 18 '20 at 08:43
  • @Prudhvi when i type the pip command straight into cmd it says that pip is not recognized and when i enter python from cmd then type the pip command it says that install which is in the pip command isn't recognized. – Campbell Skene Apr 18 '20 at 08:49
  • @AlexSusanu where python and where pip doesn't work – Campbell Skene Apr 18 '20 at 08:55
  • I think i have fixed it, I entered py -m pip install --user --force-reinstall -U pip into cmd and it says it has successfully updated – Campbell Skene Apr 18 '20 at 09:01
  • Thankyou for those who contributed – Campbell Skene Apr 18 '20 at 09:08

0 Answers0