Pip版本virtualenv不匹配,不会升级

时间:2017-01-09 13:13:28

标签: python windows pip

好的,我在虚拟环境中运行我的项目包。我通常通过PyCharm管理这些包。 PyCharm告诉我我安装了Pip 9.0.1。只有当我从命令行运行我的虚拟环境并打印pip版本时,才会说7.1.0。如果我尝试使用pip install --upgrade pip进行升级,则会收到错误

Collecting pip
  Using cached pip-9.0.1-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:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\basecommand.py", line 223, in main
    status = self.run(options, args)
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\commands\install.py", line 299, in run
    root=options.root_path,
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\req\req_set.py", line 646, in install
    **kwargs
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\req\req_install.py", line 813, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\req\req_install.py", line 1008, in move_wheel_files
    isolated=self.isolated,
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\wheel.py", line 449, in move_wheel_files
    generated.extend(maker.make(spec))
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\_vendor\distlib\scripts.py", line 323, in make
    self._make_script(entry, filenames, options=options)
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\_vendor\distlib\scripts.py", line 227, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.egg\pip\_vendor\distlib\scripts.py", line 163, in _write_script
    launcher = self._get_launcher('t')
  File "c:\python-virtualenv\arcus\lib\site-packages\pip-7.1.0-py3.5.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版本是9.0.1。我只是不知道发生了什么。希望有人可以解释一下。我已经尝试重新安装并重新安装它,我尝试使用滚轮安装,不起作用

顺便说一下,Windows。

2 个答案:

答案 0 :(得分:1)

我有同样的问题,但在这里找到答案: https://github.com/pypa/pip/issues/2669

基本上我只需要使用此命令: easy_install -U pip

答案 1 :(得分:1)

以管理员身份打开命令提示符(cmd)并运行:

pip install --user --upgrade pip

或尝试:

python -m pip install --user --upgrade pip

Relevant GitHub issue.