Adding Python Path on Windows 7

后端 未结 19 1637
盖世英雄少女心
盖世英雄少女心 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:22

    For anyone trying to achieve this with Python 3.3+, the Windows installer now includes an option to add python.exe to the system search path. Read more in the docs.

    0 讨论(0)
  • 2020-11-22 00:22

    If you have got frustrated by setting the path for the python just download the new version of python uninstall the older version of the python and while installing the new version it will ask whether to set path mark that and install

    its the best way

    0 讨论(0)
  • 2020-11-22 00:26

    write that on your Command Prompt:

    set Path=%path%
    

    Replace %path% by the Path of your Python Folder Example:

    set Path=C:/Python27
    
    0 讨论(0)
  • 2020-11-22 00:30

    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.

    0 讨论(0)
  • 2020-11-22 00:30

    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%.

    0 讨论(0)
  • You need to make changes in your system variable
    -- Right click on "My computer"
    -- Click "Properties"
    -- Click "Advanced system settings" in the side panel
    -- Click on Environment Variable -- You will two sections of user variable and system variable
    -- Under system variable section search for the variable 'Path' click on edit and add
    "C:\Python27;" (without quotes) save it
    -- Now open command line type 'path' hit enter you will see path variable has been modified
    -- Now type python --version you will see the python version

    And it is done

    0 讨论(0)
提交回复
热议问题