I've been trying to add the Python path to the command line on Windows 7, yet no matter the method I try, nothing seems to work. I've used the set
command, I've tried adding it through the Edit Environment variables prompt etc.
Further more if I run the set command on the command line it lists this
python = c:\python27
Yet it still doesn't recognize the Python command.
Reading the documentation, and various other sources hasn't seemed to help.
Edit: Just to clarify further, I've appended the path of the Python executable to PATH in edit environment prompt. Doesn't seem to work.
Make sure you don't add a space before the new directory.
Good: old;old;old;new
Bad: old;old;old; new
Working with Windows environment variables is always a horrible experience. Recently, I found an amazing tool called Rapid Environment Editor, which gives an awesomely simple GUI for managing them.
If you use chocolatey, you can install it using
choco install rapidee
. Otherwise, take a look at http://www.rapidee.com/en/downloadRe-reading this, it sounds like a paid shill, but I swear I'm not! It's just been one of the most useful utilities in my toolkit for a while and I'm surprised no one seems to know about it.
If Python was installed with another program, such as ArcGIS 10.1 in my case, then you also must include any extra folders that path to the python.exe in your Environment Variables.
So my Environment Variables looks like this:
System variables > Path > add
;C:\Python27\ArcGIS10.1
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 tryC:\SomeOther; C:\Python27
That space (␣) after the semicolon is not okay.)echo $PATH
but only backward slashes have worked for me.C:\Python27
NOTC:\Python27\
Hope this helps someone.
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.
This question is pretty old, but I just ran into a similar problem and my particular solution wasn't listed here:
Make sure you don't have a folder in your PATH that doesn't exist.
In my case, I had a bunch of default folders (Windows, Powershell, Sql Server, etc) and then a custom
C:\bin
that I typically use, and then various other tweaks likec:\python17
, etc. It turns out that the cmd processor was finding thatc:\bin
didn't exist and then stopped processing the rest of the variable.Also, I don't know that I ever would have noticed this without PATH manager. It nicely highlighted the fact that that item was invalid.