python3.6执行pip3时 Unable to create process using '"'

背景:

由于在windows操作系统中已经安装了python2.7,之前安装过python3.4,现已卸载,

将python3.6安装在C:\Python36目录下

然后进入C:\Python36目录下执行pip -V能正常使用

但是为了同时使用python2和python3,于是将python.exe改名为python3.exe,重新执行pip -V

发现错误

C:\Python36>pip3
Fatal error in launcher: Unable to create process using '"'

之前使用python3.4的经验是:升级pip

python3 -m pip install -U pip

但是由于pip已经是最新版本了

C:\Python36>python3 -m pip install -U pip
Requirement already up-to-date: pip in c:\python36\lib\site-packages\pip-9.0.1-py3.6.egg

解决方法:

删除C:\Python36\Lib\site-packages\pip软件包,重新下载pip-9.0.1(注意是.tar.gz格式的安装包)

然后进入pip-9.0.1安装包后执行python3 setup.py install,进行安装

最后删除C:\Python36\Scripts目录下的pip.exe

效果:

C:\Python36>pip -V
pip 9.0.1 from C:\Python27\lib\site-packages (python 2.7)

C:\Python36>pip3 -V
pip 9.0.1 from C:\Python36\lib\site-packages\pip-9.0.1-py3.6.egg (python 3.6)

 

点赞