简体   繁体   中英

I changed “python.exe” to “python3.exe” but now pip returns an error, how can i fix this?

So in order to make my life easier, I changed Python 2.7 to "python2.exe and Python 3.6 to "python3.exe". I then added them to my path and am able to reference them in which python2 opens Python 2.7 and python3 opens Python 3.6.

This is exactly what I want but now since I changed the names the pip command returns this:

Fatal error in launcher: Unable to create process using '"'

I still want to be able to reference python3 and run Python 3.6, but I need pip to work. Do I change a pip file to reference it? or is it something else? Please help if you can.

I strongly recommend you change the names back, because numerous scripts (pip likely included) expect the original filename.

To make your life easier when launching python files on windows, python comes with a more flexible solution. If you have a recent python3 installed on windows, the Python Launcher for Windows should be installed as well. That means you can run python 2 and 3 scripts with a py <file> command. The launcher respects shebang lines specifying the python version or you can pass a flag to choose the version manually: py -2 <file>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM