Adding Python to PATH makes it possible for you to run (use) Python from your command prompt (also known as command-line or cmd). This lets you access the Python shell from your command prompt.
;C:\python27
to the Path
variable.When setting Environmental Variables in Windows, I have gone wrong on many, many occasions. I thought I should share a few of my past mistakes here hoping that it might help someone. (These apply to all Environmental Variables, not just when setting Python Path)
Watch out for these possible mistakes:
;C:\Python27
WITHOUT any spaces. (It is common to try C:\SomeOther; C:\Python27
That space (␣) after the semicolon is not okay.)
echo $PATH
but only backward slashes have worked for me.C:\Python27
NOT C:\Python27\
Hope this helps someone.
Open cmd.exe with administrator privileges (right click on app). Then type:
setx path "%path%;C:\Python27;"
Remember to end with a semi-colon and don't include a trailing slash.
I've had a problem with this for a LONG time. I added it to my path in every way I could think of but here's what finally worked for me:
pythonexe
(or anything you want)C:\Python32\
)%pythonexe%;
to the end of what's already thereIDK why this works but it did for me.
then try typing "python" into your command line and it should work!
Edit:
Lately I've been using this program which seems to work pretty well. There's also this one which looks pretty good too, although I've never tried it.
Try adding this python.bat
file to System32
folder and the command line will now run python when you type in python
python.bat
@C:\Python27\python.exe %*
Source:
https://github.com/KartikTalwar/dotfiles/blob/master/bat/python.bat
You can set the path from the current cmd window using the PATH =
command. That will only add it for the current cmd instance. if you want to add it permanently, you should add it to system variables. (Computer > Advanced System Settings > Environment Variables)
You would goto your cmd instance, and put in PATH=C:/Python27/;%PATH%
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With