Python 3.5 pip 9 AttributeError: 'NoneType' 对象没有属性 'bytes' [英] Python 3.5 pip 9 AttributeError: 'NoneType' object has no attribute 'bytes'
问题描述
有什么问题?我尝试了python -m pip install -U pip"和python -m pip install --upgrade pip"都出现了相同的错误(和pip安装 -U --force-reinstall pip").我该怎么办?
What is the problem? I tried "python -m pip install -U pip" and "python -m pip install --upgrade pip" both with the same error (and "pip install -U --force-reinstall pip"). what should I do?
C:UsersPeymanPycharmProjectsuntitled3>python -m pip install -U pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespipasecommand.py", line 215, in main
status = self.run(options, args)
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespipcommandsinstall.py", line 342, in run
prefix=options.prefix_path,
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespip
eq
eq_set.py", line 784, in install
**kwargs
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespip
eq
eq_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespip
eq
eq_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespipwheel.py", line 462, in move_wheel_files
generated.extend(maker.make(spec))
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespip\_vendordistlibscripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespip\_vendordistlibscripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespip\_vendordistlibscripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:UsersPeymanAppDataRoamingPythonPython35site-packagespip\_vendordistlibscripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
You are using pip version 9.0.3, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
推荐答案
尝试使用easy_install -U pip
,根据这个错误报告.
好的,转到https://pypi.org/simple/pip/",然后下载最新的 .whl 文件(滚动到底部).获得后,在同一文件夹中打开 cmd(通过在文件资源管理器中单击文件"->打开 powershell/cmd"),然后键入
Okay, go to "https://pypi.org/simple/pip/", and download the latest .whl file (scroll to the bottom). When you have it, open cmd in the same folder (by clicking File -> open powershell/cmd in the file explorer), and type
pip install filename
,filename 是你下载的文件名(应该是 pip-18.0-py2.py3-none-any.whl
).
pip install filename
, with filename being the name of the file you downloaded (Should be pip-18.0-py2.py3-none-any.whl
).
尝试一下,然后告诉我它是否有效.
Try that and tell me if it works.
这篇关于Python 3.5 pip 9 AttributeError: 'NoneType' 对象没有属性 'bytes'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!