升级pip时出错AttributeError:'NoneType'对象没有属性'bytes'

问题描述 投票:0回答:1

我尝试使用以下方式升级点子:

(venv) C:\Users\Divyanshu Gupta\PycharmProjects\untitled>pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-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\divyanshu gupta\pycharmprojects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg
   from C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\Lib\site-packages\~ip-19.0.3-py3.8.egg
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip-script.py
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip-script.py
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip.exe
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip.exe
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip.exe.manifest
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip.exe.manifest
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip3-script.py
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip3-script.py
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip3.8-script.py
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip3.8-script.py
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip3.8.exe
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip3.8.exe
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip3.8.exe.manifest
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip3.8.exe.manifest
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip3.exe
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip3.exe
  Moving to c:\users\divyanshu gupta\pycharmprojects\untitled\venv\scripts\pip3.exe.manifest
   from C:\Users\Divyanshu Gupta\AppData\Local\Temp\pip-uninstall-y1i2neb1\pip3.exe.manifest

我正在跟踪错误。

Exception:
Traceback (most recent call last):
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\cli\base_command.py", line 179, in main
    status = self.run(options, args)
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\commands\install.py", line 384, in run
    installed = install_given_reqs(
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\__init__.py", line 53, in install_given_reqs
    requirement.install(
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\req_install.py", line 910, in install
    self.move_wheel_files(
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\req\req_install.py", line 437, in move_wheel_files
    move_wheel_files(
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_internal\wheel.py", line 544, in move_wheel_files
    generated.extend(maker.make(spec))
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 405, in make
    self._make_script(entry, filenames, options=options)
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 309, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 245, in _write_script
    launcher = self._get_launcher('t')
  File "C:\Users\Divyanshu Gupta\PycharmProjects\untitled\venv\lib\site-packages\pip-19.0.3-py3.8.egg\pip\_vendor\distlib\scripts.py", line 384, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'

我仅今天安装了python和pycharm,这是我尝试在python中做的第一件事。 pip install既没有更新,也不能使用pip install命令安装任何其他软件包,例如'pygame'。

python python-3.x pip pycharm
1个回答
0
投票

您可能已经安装了其他pip版本,这可能是导致问题的原因。您应该尝试找到它的安装位置并删除所有与pip相关的东西。尝试键入pip -V来检查cmd的版本和路径。在python文件夹中,尝试删除其他版本的pip。如果情况仍然存在,请使用easy_install更新pip。例如easy_install -U pip对于具有类似回溯检查的错误:this

© www.soinside.com 2019 - 2024. All rights reserved.