'python3' is not recognized as an internal

2019-01-13 15:50发布

问题:

I am using python 3.5.2 version in windows 7 and tried using python3 app.py. I am getting this error message

'python3' is not recognized as an internal or external command,
operable program or batch file. 

any specific cause about why python3 command is not working? I also verified that the PATH is added to environment variables.

回答1:

There is no python3.exe file, that is why it fails.

Try:

py

instead.

py is just a launcher for python.exe. If you have more than one python versions installed on your machine (2.x, 3.x) you can specify what version of python to launch by

py -2 or py -3



回答2:

Python3.exe is not defined in windows

Specify the path for required version of python when you need to used it by creating virtual environment for your project

Python 3

virtualenv --python=C:\PATH_TO_PYTHON\python.exe environment

Python2

virtualenv --python=C:\PATH_TO_PYTHON\python.exe environment

then activate the environment using

.\environment\Scripts\activate.ps1



回答3:

For Python 27

virtualenv -p C:\Python27\python.exe django_concurrent_env

For Pyton36

 virtualenv -p C:\Python36\python.exe django_concurrent_env


回答4:

If python2 is not installed on your computer, you can try with just python instead of python3