'Setting up python on windows 10 pro
Have set up Python 3.5 and Python 2.7.11 yet both have not been recognized by the command prompt. Also have download pip.py, and the command prompt has not recognized it. Have set the PATH to
C:\Python34;C:\Python34\Lib\site-packages\;C:\Python34\Scripts\;
And have also added the Python 3.5 to PATH through the installation prompts. The computer is a Dell and is a Windows 10 pro computer.
'python' is not recognized as an internal or external command, operable program, or batch file.
'pip' is not recognized as an internal or external command, operable program, or batch file.
Solution 1:[1]
I think you have to create a variable called PYTHONPATH, follow the following steps
navigate to My Computer > Properties > Advanced System Settings > Environment Variables >
Then under system variables create a new Variable called PythonPath
.
In this variable include C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\other-foolder-on-the-path
(no extra spaces)
if someone is there that above is not working, then kindly append to your PATH with the C:\Python27
then it should surely work
for complete details here is a link document
Solution 2:[2]
Did you check the path after your modifications? You may need to close and reopen console windows, or even reboot to update your environment variables.
Instead, try py
, which is the Python Launcher. It should be installed in C:\Windows which is already in the path. It was an option during install (seee options at bottom of dialog below). Adding Python to the path is also an option, but installing two versions makes only the first one in the path work.
It allows you to pick the version of Python to run:
py # Run default python version...PY_PYTHON env. var can override this.
py -3 # Run the latest Python3 found on the system.
py -2 # Run the latest Python2 found on the system.
py -2.7 # Specifically run Python 2.7.
py -2.7-32 # Specifically run 32-bit Python 2.7 on a 64-bit system.
You can also add a #!python3
comment to the top of a script and double-clicking the file in Explorer will use that version of Python.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Mark Tolonen |