Python 2 and 3 in Powershell
I have both versions on my PC because I'm working through different tutorials, (I'm still a noob). I've seen a couple of similar questions on here, but nothing specific to Powershell.
When I run python in Powershell it brings up 2.7, but how do I specify that I want Python 3? Are there other issues that I need to be aware of? For example when running scripts from notepad++?
The command "py" (if v2 is the default) or "py -2" should launch Python 2.7, "py -3" should launch Python 3. See here for the details.
I've found this post as well. It might be helpful.
This one will help you check the current version you are using, if you desire to change that see here.
Should you want to pop out of the shell.
Cheers and have fun with Python ;)
You can install Python3 via Chocolatey, AFAIK it will bring python3
command into your realm. Do not forget to uninstall previously installed Python3 before it.
Also, you may try to create alias for Python3, see Microsoft doc.
链接地址: http://www.djcxy.com/p/29024.html上一篇: PSVersion无法识别