Change Default Python Version For Command Prompt
Solution 1:
You can run multiple python versions on your machine.
To make Python 3.6 default, just put path of Python 3.6 before path of Python 3.4 in system variables.
OR
In python34 directory on C drive rename python.exe to python3.4.exe. After doing this if you run command python in command prompt it will open python 3.6. And to run python 3.4 you need to run command python3.4as we have renamed it to python3.4.exe in python34 directory.
After making changes in system variables in environment variables you just need to restart your command prompt. No need to restart machine.
Solution 2:
After some communication I guess I know what is the problem. Have you checked your system wide environment variables? Here is a link about how to:
- In Search, search for and then select: System (Control Panel)
- Click the Advanced system settings link.
- Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
- In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Further, your application(your command prompt) wide environment variables are appended after system wide ones.
Solution 3:
After doing a restart of my machine after deleting python34 from my system path variables as @Talha Junaid mentioned in the comments, my python now defaults to python3.6 when accessed through command prompt, windows must load all the path variables on startup and hold them in memory until a restart occurs.
Steps for anyone else starting the process.
Windows 10
Type "System" into the search bar to go to system settings in the control panel (Control Panel\All Control Panel Items\System)
Click "Advanced System Settings" -> 2Environment Variables2
For User Variables:
- Highlight the row for "Path" by clicking on it and then click the "Edit" button
- Highlight by clicking the version of python you want to remove from your environment variables and then click the "Delete" button.
Repeat steps 3 and 4 for System Environment Variables.
Close all the windows by clicking the "Ok" buttons
Restart your machine
Solution 4:
I had the same problem and, after changing python.exe by python3.6.exe, I downloaded version 8 from the windows store and installation and replacement were done automatically and the default version was update as well.
Post a Comment for "Change Default Python Version For Command Prompt"