Python 3.5 pip 9 属性错误 : 'NoneType' object has no attribute 'bytes'

标签 python pip python-3.5

问题是什么?我尝试了“python -m pip install -U pip”和“python -m pip install --upgrade pip”都出现了同样的错误(和“pip安装 -U --force-reinstall pip").我该怎么办?

C:\Users\Peyman\PycharmProjects\untitled3>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:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\req\req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\wheel.py", line 462, in move_wheel_files
    generated.extend(maker.make(spec))
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
    self._make_script(entry, filenames, options=options)
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
    launcher = self._get_launcher('t')
  File "C:\Users\Peyman\AppData\Roaming\Python\Python35\site-packages\pip\_vendor\distlib\scripts.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,根据 bug report .

编辑:好的,转到“https://pypi.org/simple/pip/”,并下载最新的 .whl 文件(滚动到底部)。有了它后,在同一文件夹中打开 cmd(通过单击文件 -> 在文件资源管理器中打开 powershell/cmd),然后键入

pip install filename,其中 filename 是您下载的文件的名称(应为 pip-18.0-py2.py3-none-any.whl)。

试一试,告诉我它是否有效。

关于Python 3.5 pip 9 属性错误 : 'NoneType' object has no attribute 'bytes' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52460484/

相关文章:

Python;如何将方法导入类 'pluginstyle' ?

Python:是否有语法级支持从元组中解包到*匿名*函数的参数?

python - 无法在 Windows 上安装 pymssql

progress-bar - 使用tqdm的asyncio aiohttp进度栏

python - python 3.6 的 ATD(截止日期后)无法安装

Python3,理解 tkinter-mainloop() 或 QtPy-exec_() 中的 "GUI loop"

python - 在Elasticsearch中删除嵌套数组

python - 如何使用 pyenv、virtualenv 和 pipenv?

python - 安装 Anaconda Python 时出现冲突

python - 如何从私有(private)认证的 Artifactory PyPI 存储库中提取 Python 包?