一、背景:
在使用pycharm(2018.3)创建python项目时,如果采用虚拟环境的方式,默认安装pip版本是10.0.1。执行pip list会提示
You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
但是,在虚拟环境中执行
python -m pip install --upgrade pip
时就会出现如下错误导致升级失败,而且虚拟环境中原先的pip10也被破坏了。错误内容如下:
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "D:\appworks\pipdemo\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip\_internal\basecommand.py", line 228, in main
status = self.run(options, args)
File "D:\appworks\pipdemo\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip\_internal\commands\install.py", line 335, in run
use_user_site=options.use_user_site,
File "D:\appworks\pipdemo\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip\_internal\req\__init__.py", line 49, in install_given_reqs
**kwargs
File "D:\appworks\pipdemo\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip\_internal\req\req_install.py", line 748, in install
use_user_site=use_user_site, pycompile=pycompile,
File "D:\appworks\pipdemo\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip\_internal\req\req_install.py", line 961, in move_wheel_files
warn_script_location=warn_script_location,
File "D:\appworks\pipdemo\v