報錯如下:
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升級?直接命令即可,如下。