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 ..'
Install Python On Windows 7
larslarsThis tutorial will describe how to install both Python versions (2.7 and 3.6) on a Windows 10 environment. Additionally, how to add python path in windows 10 will be discussed. “PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located”.
9 Answers
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:
- 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/)
- Run the file
- Select install for all users or install just for me, click Next
- You'll see it installs under the C:Python27 folder, click Next
- Click Next again for the 'Customize Python' step
- Click Finish
- Open Control Panel, then System
- Click 'Advanced system settings' on the left
- Click the 'Environment Variables' button
- 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)
- Without deleting any other text, add
C:Python27;
(include the semi-colon) to the beginning of the 'Variable value' and click OK. - 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.
Easiest way is to open CMD or powershell as administrator and type
Installing Python On Windows 7 64 Bit
System variables usually require a restart to become effective. Does it still not work after a restart?
bnp887bnp887Make 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:Python27Scripts;
...not...
{last path entry}; C:Python27; C:Python27Scripts;
How to install Python / Pip on Windows Steps
- Visit the official Python download page and grab the Windows installer for the latest version of Python 3.python.org/downloads/
Run the installer. Be sure to check the option to add Python to your PATH while installing.
Open PowerShell as admin by right clicking on the PowerShell icon and selecting ‘Run as Admin’
To solve permission issues, run the following command:
Set-ExecutionPolicy Unrestricted
Next, set the system’s PATH variable to include directories that include Python components and packages we’ll add later. To do this:C:Python35-32;C:Python35-32Libsite-packages;C:Python35-32Scripts
download the bootstrap scripts for easy_install and pip from https://bootstrap.pypa.io/ez_setup.pyget-pip.py
Save both the files in Python Installed folderGo to Python folder and run following:Python ez_setup.pyPython get-pip.py
To create a Virtual Environment, use the following commands:
cd c:pythonpip install virtualenvvirtualenv test.testScriptsactivate.ps1pip install IPythonipython3Now You can install any Python package with pip
That’s it !!happy codingVisit This link for Easy steps of Installation python and pip in windows http://rajendralora.com/?p=183
tinlyxType this in Windows PowerShell
or CMD
:
After running the command, please restart PowerShell
or CMD
. If it still doesn't work, restart your PC.
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
i'm using python 2.7 in win 8 too but no problem with that. maybe you need to reastart your computer like wclear said, or you can run python command line program that included in python installation folder, i think below IDLE program. hope it help.
GUI Option:
Open
System Properties
a. Type it in the
Start Menu
b. Use the keyboard shortcut Win+Pause)
c. From
Windows Explorer
address bar go to%windir%System32SystemPropertiesProtection.exe
d. Write
SystemPropertiesProtection
in run window and press EnterSwitch to the
Advanced
tab- Click
Environment Variables
- Select
PATH
in theSystem variables
section - Click
Edit
- Add python's path to the end of the list (the paths are separated by semicolons).
For example:
Command Line Option:
- Run Command Prompt as administrator
Check existing paths under
PATH
variable (the paths are separated by semicolons). If your python folder already listed then no need to add again. Default python folder isC:Python27
C:Windowssystem32>path
orC:Windowssystem32>echo %PATH%
Append python path using
setx
command. The/M
option sets the variable atSYSTEM
scope.
The default behavior is to set it for the USER
.
protected by Community♦Jul 6 '18 at 16:49
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?