3

I work on an api that run python3 scripts like python3 <scriptname.py>. This api initially run on a linux system. Unfortunately I make the local development of it on a windows. Is there a way to simulate this behaviour so that when I run in powershell python3 -V it give me the version of python.

I have allready python 3 installed on my computer. I tried to add the path to my python.exe to the system variables with for variable the string python3. But after registering and restarting powershell and type python3 -V I still get the error that «python3» is not recognized as a command applet name.

Does anyone have any ideas?

2 Answers 2

5

Once python is in your path, you can define a PowerShell alias for python3.

PS > New-Alias python3 python
PS > python3 -V
python 3.6.5

In order to have this alias as a permanent one, refer to this question: Permanent PowerShell Aliases.

Sign up to request clarification or add additional context in comments.

Comments

0

I found tricky solution.
Once python is in your path, go to python installed path and copy python.exe and named duplicated one as python3.exe

enter image description here

1 Comment

Thanks for posting a solution but this is really a tricky one :) I definitively recommend yakobyd's answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.