Installing Python 2.7 on Windows 8

140,302

Solution 1

I think that the essence of this question is how to install Python and be able to use it from the command line. The steps below show how to get all that working. Check that you didn't miss anything:

  1. From https://www.python.org/download/releases/2.7.6 download appropriate Python 2.7.6 Windows Installer. (If that link doesn't work, check https://www.python.org/downloads/)
  2. Run the file
  3. Select install for all users or install just for me, click Next
  4. You'll see it installs under the C:\Python27 folder, click Next
  5. Click Next again for the 'Customize Python' step
  6. Click Finish
  7. Open Control Panel, then System
  8. Click 'Advanced system settings' on the left
  9. Click the 'Environment Variables' button
  10. Under 'System variables' click the variable called 'Path' then the 'Edit...' button. (This will set it for all users, you could instead choose to edit the User variables to just set python as a command prompt command for the current user)
  11. Without deleting any other text, add C:\Python27; (include the semi-colon) to the beginning of the 'Variable value' and click OK.
  12. Click OK on the 'Environment Variables' window.

Open a new command prompt window type python, you will have python running in the command prompt. Note: command prompt windows open prior to setting the Environment Variable will not have the python command available.

Solution 2

Easiest way is to open CMD or powershell as administrator and type

set PATH=%PATH%;C:\Python27

Solution 3

System variables usually require a restart to become effective. Does it still not work after a restart?

Solution 4

there is a simple procedure to do it go to controlpanel->system and security ->system->advanced system settings->advanced->environment variables then add new path enter this in your variable path and values

enter image description here

Solution 5

Make sure you don't put a space between the semi-colon and the new folder location that you are adding to the path.

For example it should look like...

{last path entry};C:\Python27;C:\Python27\Scripts;

...not...

{last path entry}; C:\Python27; C:\Python27\Scripts;

Share:
140,302

Related videos on Youtube

lars
Author by

lars

Updated on July 28, 2022

Comments

  • lars
    lars almost 2 years

    So I'm trying python 2.7 on my Windows. It is running Windows 8. I cannot add it to my path. I've done the usual: using the advanced system settings, environment variables, adding C:\Python27 in system variables.

    However, when I type Python in command prompt it says 'python is not recognized ..'

    • lit
      lit about 10 years
      If the Python installer changes the PATH variable, it will not be seen in the current cmd.exe shell. A new cmd.exe shell must be started. After starting a new cmd.exe shell, use the following command to see if Python was added to the path. ECHO %PATH% If not, use the Windows GUI through Control Panel, then start a new cmd.exe shell.
  • Akhil
    Akhil about 10 years
    Step 1 link is broken. Currently working link : python.org/download/releases/2.7.6
  • dbasch
    dbasch almost 10 years
    Note that you can also add a Path environment variable to the User variables for XXXXX section. Then it won't pollute the path for every user of the computer. Also, there is no need to reboot. You can close the command prompt window and re-open a new one which will use the new Path.
  • frlan
    frlan over 9 years
    Reboot is not needed. Just restart the tool needing Python
  • A.A
    A.A over 4 years
    Step 11. in Windows 10, ignore the semi-colon. add only C:\Python27