Adding Python Path on Windows 7

后端 未结 19 1604
盖世英雄少女心
盖世英雄少女心 2020-11-21 23:37

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\

19条回答
  •  鱼传尺愫
    2020-11-22 00:07

    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:

    1. Kill and reopen your shell window: Once you make a change to the ENVIRONMENTAL Variables, you have to restart the window you are testing it on.
    2. NO SPACES when setting the Variables. Make sure that you are adding the ;C:\Python27 WITHOUT any spaces. (It is common to try C:\SomeOther; C:\Python27 That space (␣) after the semicolon is not okay.)
    3. USE A BACKWARD SLASH when spelling out your full path. You will see forward slashes when you try echo $PATH but only backward slashes have worked for me.
    4. DO NOT ADD a final backslash. Only C:\Python27 NOT C:\Python27\

    Hope this helps someone.

提交回复
热议问题