Windows 7, Python 3.4.3, updated pip in base. Created virtualenv, saw that it was still on pip 6.0.8
Activated venv, ran python -m pip install pip -U
log:
Installing collected packages: pip
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Successfully uninstalled pip-6.0.8
Rolling back uninstall of pip
...
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
However, next time I run pip -V, it reports pip 6.1.1, so what is the effect of the error?
So, this indicates that the finder didn't find the requested package. There's a reference to a closed issue 31 there in the code, but at a minimum we should be more defensive and report the parameters that failed ere.
Thanks that's good to know. So it uninstalled/installed correctly, but then it goes back and tries to find the old version again which fails?
That failure is in ScriptMaker, so I suspect it was at the point of making the pip.exe that it failed, and further that the uninstall rollback didn't really do much, so you've got a new pip.exe entrypoint which is importing the newly installed pip version, explaining the error you're seeing.
To see if the bug is fixed, try doing a pip install -U --reinstall pip
I get no such option: --reinstall
sorry, --force-reinstall
yes, no errors this time.
Another report of the same: http://paste.ubuntu.com/10787243/ followed by http://paste.ubuntu.com/10787273/
So both pip 6.0.8 and 1.5.6 fail to install 6.1.1 on Windows
pip install --upgrade pip
I am having the same problem: 6.0.8 to 6.1.1 (Python 2.7.8)
"pip install -U --force-reinstall pip" does not solve the issue for me.
C:\Python27
λ pip install --upgrade pip
You are using pip version 6.0.8, however version 6.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-6.1.1-py2.py3-none-any.whl#md5=172eb5abab25a5e0f7a7b63c7a49378d
Using cached pip-6.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Successfully uninstalled pip-6.0.8
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\basecommand.py", line 232, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\commands\install.py", line 347, in run
root=options.root_path,
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\req\req_set.py", line 549, in install
**kwargs
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\req\req_install.py", line 754, in install
self.move_wheel_files(self.source_dir, root=root)
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\req\req_install.py", line 963, in move_wheel_files
isolated=self.isolated,
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\wheel.py", line 344, in move_wheel_files
generated.extend(maker.make(spec))
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 323, in make
self._make_script(entry, filenames, options=options)
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 227, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 163, in _write_script
launcher = self._get_launcher('t')
File "c:\python27\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 302, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
I also experience this on Python 2.7.9 x64, on Windows 8.1
e:\>pip install -U --force-reinstall pip
You are using pip version 6.0.8, however version 6.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
Using cached pip-6.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Successfully uninstalled pip-6.0.8
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\basecommand.py", line 232, in main
status = self.run(options, args)
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\commands\install.py", line 347, in run
root=options.root_path,
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\req\req_set.py", line 549, in install
**kwargs
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\req\req_install.py", line 754, in install
self.move_wheel_files(self.source_dir, root=root)
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\req\req_install.py", line 963, in move_wheel_files
isolated=self.isolated,
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\wheel.py", line 344, in move_wheel_files
generated.extend(maker.make(spec))
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 323, in make
self._make_script(entry, filenames, options=options)
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 227, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 163, in _write_script
launcher = self._get_launcher('t')
File "c:\python27x64\lib\site-packages\pip-6.0.8-py2.7.egg\pip\_vendor\distlib\scripts.py", line 302, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
pip 1.5.6 failed to upgrade to 7.0.1 on python 3.4.3 on Windows
Collecting pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-7.0.1-py2
.py3-none-any.whl#md5=9b403ba9b82d4a1e5fda5b6cc8952b57
Using cached pip-7.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 6.0.8
Exception:
Traceback (most recent call last):
File "E:\本地下载\python\lib\site-packages\pip\basecommand.py", line 232,
in main
status = self.run(options, args)
File "E:\本地下载\python\lib\site-packages\pip\commands\install.py", line
347, in run
root=options.root_path,
File "E:\本地下载\python\lib\site-packages\pip\req\req_set.py", line 543,
in install
requirement.uninstall(auto_confirm=True)
File "E:\本地下载\python\lib\site-packages\pip\req\req_install.py", line 6
25, in uninstall
for path in pip.wheel.uninstallation_paths(dist):
File "E:\本地下载\python\lib\site-packages\pip\wheel.py", line 407, in uni
que
for item in fn(*args, **kw):
File "E:\本地下载\python\lib\site-packages\pip\wheel.py", line 426, in uni
nstallation_paths
r = csv.reader(FakeFile(dist.get_metadata_lines('RECORD')))
File "E:\本地下载\python\lib\site-packages\pip\_vendor\pkg_resources\__ini
t__.py", line 1540, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "E:\本地下载\python\lib\site-packages\pip\_vendor\pkg_resources\__ini
t__.py", line 1537, in get_metadata
return self._get(self._fn(self.egg_info, name)).decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb1 in position 22942:
invalid start byte
Same sh** with pip 7.1.0 with Python 2.7 on Window 7 64bit - see below.
BUT HAPPILY easy_install -U pip
did it for me and upgraded to 7.1.2 :)
H:\>pip install -U pip
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Collecting pip
Using cached pip-7.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 7.1.0
Uninstalling pip-7.1.0:
Successfully uninstalled pip-7.1.0
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\basecommand.py", line 223, in main
status = self.run(options, args)
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\commands\install.py", line 299, in run
root=options.root_path,
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\req\req_set.py", line 646, in install
**kwargs
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\req\req_install.py", line 813, in install
self.move_wheel_files(self.source_dir, root=root)
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\req\req_install.py", line 1008, in move_wheel_files
isolated=self.isolated,
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\wheel.py", line 449, in move_wheel_files
generated.extend(maker.make(spec))
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\_vendor\distlib\scripts.py", line 323, in make
self._make_script(entry, filenames, options=options)
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\_vendor\distlib\scripts.py", line 227, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\_vendor\distlib\scripts.py", line 163, in _write_script
launcher = self._get_launcher('t')
File "c:\python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\_vendor\distlib\scripts.py", line 302, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
Same problem on Windows 7 x64, pip 7.1.2, pypy 2.4.0 on initial installation using the get-pip
script:
Installing collected packages: pip, setuptools, wheel
Exception:
Traceback (most recent call last):
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/basecommand.py
", line 211, in main
status = self.run(options, args)
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/commands/insta
ll.py", line 311, in run
root=options.root_path,
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/req/req_set.py
", line 646, in install
**kwargs
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/req/req_instal
l.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/req/req_instal
l.py", line 998, in move_wheel_files
isolated=self.isolated,
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/wheel.py", lin
e 449, in move_wheel_files
generated.extend(maker.make(spec))
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/_vendor/distli
b/scripts.py", line 353, in make
self._make_script(entry, filenames, options=options)
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/_vendor/distli
b/scripts.py", line 257, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/_vendor/distli
b/scripts.py", line 193, in _write_script
launcher = self._get_launcher('t')
File "c:\users\manveru\appdata\local\temp\tmpz6jby3\pip.zip\pip/_vendor/distli
b/scripts.py", line 332, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
The trick with:
pypy -m pip install -U --force-reinstall pip
worked.
I had the same problem, this worked for me http://stackoverflow.com/questions/31792591/error-while-upgrading-to-pip-7-1-10-on-windows-8-1-python-2-7/31799230#31799230
easy_install -U pip worked for me . Thanks :+1:
easy_install -U pip worked for me too . Thanks for all
Win 10 and Python 3.4.4, same error, the pip force reinstall thing didn't work but the easy_install -U pip did.
Same here, using easy_install helped.
Yep, same. Windows 10. Python 2.7.10.
easy_install -U pip
The above command worked.
Yes, the same error. Windows 10. Python 3.5.1.
easy_install -U pip
But the above command worked
Windows 10. Python 2.7.12.
easy_install -U pip
可以更新,不过如果Python安装在C盘可能没有权限操作文件会报错,用管理员权限启动cmd可以解决。
easy_install -U pip worked for me . Thanks :+1:
please note that easy_install -U pip has some dire consequences as it does an egg based install instead of a sane install
Closing this, if it continues to happen please reopen this issue or open a new one with reproduction steps.
I was run 'python -m pip install -U --force-reinstall pip' , python 3.6
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pipcommands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\wheel.py", line 463, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip_vendor\distlib\resources.py", line 324, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Getting the error on a Windows 10 virtualenv.
> python --version
Python 3.6.3
> pip --version
pip 9.0.1 from c:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg (python 3.6)
> python -m pip install --upgrade pip
Collecting pip
Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 729kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\wheel.py", line 462, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\...\venv\lib\site-packages\pip-9.0.1-py3.6.egg\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
@OrangeDog I'm curious how you have pip 9.0.1 installed as an egg. That shouldn't happen usually.
@pradyunsg interesting.
The system Python was installed with the official Windows installer.
The virtualenv was created by IntelliJ IDEA (with the Python plugin).
Older versions of IntelliJ IDEA installed pip as an egg. I reported that some time ago (over a year, I think) and I thought they'd fixed it. Are you using an old version of IDEA?
That was only one version ago, and the ticket is still open, so I guess that's why.
Is there an easy way to re-install it as not an egg?
I also faced this issue, when using Intellij IDEA to set up the virtualenv.
Python: 3.6.3
Pip: 9.0.1
Intellij: 2018.1 (Ultimate Edition) 181.4203.550
Windows 7: 6.1
Running easy_install -U pip
seemed to work for me. Not sure if @RonnyPfannschmidt's warning is relevant as I don't know what an "egg based install" is. It installed pip 10.0.0b2 and seems to be working fine.
Is there an easy way to re-install it as not an egg?
virtualenv --clear
will do it, but also wipes all the other packages
I'm seeing this same problem trying to upgrade pip within a virtualenv that was created with pip 9.0.1 by PyCharm.
This seems to be occurring again, with pip 9 -> pip 10 upgrades. Issue for that is #5343.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Same sh** with pip 7.1.0 with Python 2.7 on Window 7 64bit - see below.
BUT HAPPILY
easy_install -U pip
did it for me and upgraded to 7.1.2 :)