Adding Python Path on Windows 7
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.
;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.
链接地址: http://www.djcxy.com/p/26364.html