pip2版本20.3.4,windows环境,用户名中文
我想要用一个脚本,缺好几个包,但是发现pip2用不了了,
报错如下
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:581)'),)': /simple/numpy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:581)'),)': /simple/numpy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:581)'),)': /simple/numpy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:581)'),)': /simple/numpy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:581)'),)': /simple/numpy/
Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:581)'),)) - skipping
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:581)'),)) - skipping
Traceback (most recent call last):
File "C:\python27_new\Scripts\pip2-script.py", line 9, in <module>
load_entry_point('pip==20.3.4', 'console_scripts', 'pip2')()
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_internal\cli\main.py", line 75, in main
return command.main(cmd_args)
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_internal\cli\base_command.py", line 116, in main
return self._main(args)
File "C:\python27_new\lib\contextlib.py", line 24, in __exit__
self.gen.next()
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_internal\cli\command_context.py", line 28, in main_context
yield
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 479, in __exit__
_reraise_with_existing_context(exc_details)
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 353, in _reraise_with_existing_context
exec("raise exc_type, exc_value, exc_tb")
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 468, in __exit__
if cb(*exc_details):
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 396, in _exit_wrapper
return cm_exit(cm, *exc_details)
File "C:\python27_new\lib\contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_internal\utils\temp_dir.py", line 47, in global_tempdir_manager
_tempdir_manager = old_tempdir_manager
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 479, in __exit__
_reraise_with_existing_context(exc_details)
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 353, in _reraise_with_existing_context
exec("raise exc_type, exc_value, exc_tb")
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 468, in __exit__
if cb(*exc_details):
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\contextlib2.py", line 396, in _exit_wrapper
return cm_exit(cm, *exc_details)
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_internal\utils\temp_dir.py", line 178, in __exit__
self.cleanup()
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_internal\utils\temp_dir.py", line 207, in cleanup
rmtree(ensure_text(self._path))
File "C:\python27_new\lib\site-packages\pip-20.3.4-py2.7.egg\pip\_vendor\six.py", line 935, in ensure_text
return s.decode(encoding, errors)
File "C:\python27_new\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xcd in position 9: invalid continuation byte
除了安装,其他pip2命令,如pip2 --version pip2 list 这些都能正常使用,一开始以为是pip2版本不够新,但是查了一下,我的20.3.4应该就是最新的了,我队友也能正常使用pip2安装包,他环境跟我差不多,都是20.3.4,用户名中文,我的无论安什么都报错。百度搜到的回答都不管用,还以为是不是之前python安装出了什么问题,重装从2.7.18换了一个2.7.9,但是依旧没有解决问题,中文路径也不是原因,希望能有师傅能帮忙解决一下。
pip的安装方法是从官网下的包,python2 setup.py install 安装的(build我试过,但是python2.7.9可能太老了,没有这个命令,原来的2.7.18可以)。
试试能不能升级 pip
python2 -m pip install --upgrade pip