报错如下:
You are using pip version 8.0.3, however version 8.1.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' comm and.
系统环境:
操作系统:windows8.1
python版本:2.7.11 ,3.4.4 同时安装
python2.7.11的pip版本:8.0.1,需要升级到8.1.2,但是升级时报错如下,处理如下。
python3.4.4 的pip版本:8.1.1,需要升级到8.1.2,直接升级命令即可。
原因分析:
由于之前一直安装的是同时安装的python2.7.11和python3.4.4,很久之前update过pip,最近发现pip又不能使用了。
py2更新时报如下的错。
上次update已是很久之前的事情了,一时不确定当时是怎么处理的了。网上查了一圈,终于搞定了,现在记录一下。解决方法如下:
1、下载安装get-pip.py 下载地址:http://pan.baidu.com/s/1hr1XQBi
2、安装get-pip.py 安装命令 : py2 C:\Python27\get-pip.py
3、pip安装成功,提示如下:
4、pip安装成功后,再次update pip,命令如下:py2 -m pip install -U pip
结果如下:
5、可以看到pip已经从8.0.3升级到8.1.1;同4,再次升级,得到升级版本8.1.2;内容如下:
C:\windows\system32>C:\Python27\python2.exe -m pip install -U pip setuptools
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Collecting setuptools
Using cached setuptools-24.0.2-py2.py3-none-any.whl
Installing collected packages: pip, setuptools
Found existing installation: pip 8.0.3
Uninstalling pip-8.0.3:
Successfully uninstalled pip-8.0.3
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\pip\basecommand.py", line 209, in main
status = self.run(options, args)
File "C:\Python27\lib\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Python27\lib\pip\req\req_set.py", line 731, in install
**kwargs
File "C:\Python27\lib\pip\req\req_install.py", line 845, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Python27\lib\pip\req\req_install.py", line 1044, in move_wheel_files
isolated=self.isolated,
File "C:\Python27\lib\pip\wheel.py", line 460, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Python27\lib\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Python27\lib\pip\_vendor\distlib\scripts.py", line 276, in _make_scri
pt
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Python27\lib\pip\_vendor\distlib\scripts.py", line 212, in _write_scr
ipt
launcher = self._get_launcher('t')
File "C:\Python27\lib\pip\_vendor\distlib\scripts.py", line 351, in _get_launc
her
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
You are using pip version 8.0.3, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
C:\windows\system32>py2 C:\Python27\get-pip.py
C:\windows\system32>C:\Python27\python2.exe C:\Python27\get-pip.py
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.0.3
Uninstalling pip-8.0.3:
Successfully uninstalled pip-8.0.3
Successfully installed pip-8.0.3
You are using pip version 8.0.3, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
安装get-pip.py后第一次运行,可以看到pip版本成功安装了pip-8.1.1;
C:\windows\system32>py2 -m pip install -U pip
C:\windows\system32>C:\Python27\python2.exe -m pip install -U pip
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.0.3
Uninstalling pip-8.0.3:
Successfully uninstalled pip-8.0.3
Successfully installed pip-8.1.1
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
安装get-pip.py后第二次运行,可以看到pip版本成功安装了pip-8.1.2;
C:\windows\system32>py2 -m pip install -U pip
C:\windows\system32>C:\Python27\python2.exe -m pip install -U pip
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-8.1.2
C:\windows\system32>
python3.4.4的pip升级 直接命令即可,如下。