Environment
Description
Error occurs during upgrade.
Expected behavior
pip installs without error.
How to Reproduce
Output
Collecting pip
Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.0.3
Uninstalling pip-19.0.3:
Successfully uninstalled pip-19.0.3
Rolling back uninstall of pip
Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-akvm93y4\pip.exe
Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.7.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-akvm93y4\pip3.7.exe
Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-akvm93y4\pip3.exe
Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip-19.0.3.dist-info\
from c:\users\user\appdata\roaming\python\python37\site-packages\~ip-19.0.3.dist-info
Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip\
from c:\users\user\appdata\roaming\python\python37\site-packages\~ip
Exception:
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\base_command.py", line 179, in main
status = self.run(options, args)
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\commands\install.py", line 393, in run
use_user_site=options.use_user_site,
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\__init__.py", line 57, in install_given_reqs
**kwargs
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 913, in install
use_user_site=use_user_site, pycompile=pycompile,
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 445, in move_wheel_files
warn_script_location=warn_script_location,
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\wheel.py", line 544, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 405, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 309, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 245, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 384, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I also tried using solution from https://github.com/pypa/pip/issues/5820#issuecomment-428611054
C:\WINDOWS\system32>python -m pip install -U --force-reinstall pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.0.3
Uninstalling pip-19.0.3:
Successfully uninstalled pip-19.0.3
Rolling back uninstall of pip
Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-1kl45zbn\pip.exe
Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.7.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-1kl45zbn\pip3.7.exe
Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.exe
from C:\Users\User\AppData\Local\Temp\pip-uninstall-1kl45zbn\pip3.exe
Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip-19.0.3.dist-info\
from c:\users\user\appdata\roaming\python\python37\site-packages\~ip-19.0.3.dist-info
Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip\
from c:\users\user\appdata\roaming\python\python37\site-packages\~ip
Exception:
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\base_command.py", line 179, in main
status = self.run(options, args)
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\commands\install.py", line 393, in run
use_user_site=options.use_user_site,
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\__init__.py", line 57, in install_given_reqs
**kwargs
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 913, in install
use_user_site=use_user_site, pycompile=pycompile,
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 445, in move_wheel_files
warn_script_location=warn_script_location,
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\wheel.py", line 544, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 405, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 309, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 245, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 384, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
See also #6546 which seems to have a similar traceback.
You can have different pip version already installed, on cmd type pip -V
to check version and path.
Your pip location should be "python\python37-32\lib\site-packages\pip (python 3.7)" i.e. inside python folder, try removing other version of pip. If situation persists update pip using easy_install.
easy_install -U pip
worked for me.
easy_install -U pip
worked for me.
@gagibran, might actually work but I wanted to notify devs about problem with native installer. In the end, PiP should be able to update itself, am I right?
@DobroAlex, actually easy_install was hack and pip is working perfectly fine, it's just that you need to do it right way, the problem above according to me is that you are updating different pip from pip, it's kind of confusing, but it is the case. When I checked what is path of the pip I was using, it was different from the correct, actually in my case there were two pips, one was original and other was created at the location where all the cache files for pip were found and the "pip" command I was using had path which was in cache and which cannot be updated, I don't know how it was created but it was and then I changed the path of pip and run the command for upgrading pip, it's works smoothly.
Solved. The problem was that there was old pip installed in Roam Data (don't know how exactly did it get there) and it was causing issues because it was not properly installed. The solution is to find there your pip is (thanks to @vipul02 https://github.com/pypa/pip/issues/7069#issuecomment-544145785) and erase everything pip-related there. Next step is to download pip properly (I used curl and my python 3.7 location in C:\Program Files\Python37) and then install it. That's pretty much it
I uesd ithis command " easy_install -U pip "
and work for me
"easy_install -U pip" works!
Most helpful comment
"easy_install -U pip" works!