Configure environment variables in Python and environment variables in python
After Python is installed, run cmd (win + R): Enter Python in the console. If the installation is complete, open Python in the console: If Python is not added to the environment variable, will prompt"Python is neither an internal or external command, nor a program or batch file that can be run"In this case, you need to add Python to the environment variable.1. Add system settings.Control Panel → system and security → system → advanced system settings, click environment variables, and then click path to copy the Python installation address to the new variable, remember to add a semicolon before.2. Add in command line mode.Assume that the Python installation path is c: \ python36, win + R run cmd to open the command line, and enter:
PATH = PATH; c: \ python
After the preceding environment variables are successfully set, you can directly run python on the command line. If a similar problem occurs during use, add the path in the same way.