简体   繁体   English

命令提示中的Python路径

[英]Python path in command prompt

I had Python3 installed on my computer after Python2. Python2之后,我在计算机上安装了Python3。 Then I executed "python" in command prompt, Python3 showed up. 然后我在命令提示符下执行“ python”,出现了Python3。 How does the command prompt find Python without specifying the path? 命令提示符如何在不指定路径的情况下找到Python? Can I switch it back to Python2 without reinstalling? 是否可以在不重新安装的情况下将其切换回Python2?

If you are on windows you need the python27 to be first in your PATH enviroment variable 如果您在Windows上,则需要将python27首先放在PATH环境变量中

PATH=c:\python27;otherstuff...;c:\python35;...;

or just write 或只是写

py -2

To start python2 启动python2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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