YesIAmThatGuy
YesIAmThatGuy

Reputation: 97

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++?

Upvotes: 2

Views: 6376

Answers (2)

Remy J
Remy J

Reputation: 729

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 ;)

Upvotes: 5

Bohdan Ivanov
Bohdan Ivanov

Reputation: 816

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.

Upvotes: 0

Related Questions