python' is not recognized as an internal or external command, operable program or batch file when entering "python" or "pip" in the terminal

1. Problem: When the python parser is successfully installed, I want to enter python in the windows terminal to open it, and find that "python" appears when "python" is not an internal or external command, nor is it a runnable program or batch file.

2. Reason: Because the environment is not configured properly, the system uses the python parser.

3. Solution:

(1) Find the installation path of python and locate the absolute path of python.exe:

insert image description here

(2) Open the control panel, select "System and Security" → "System" → "Advanced System Settings" → "Environment Variables", and then double-click "Path" in the user variables:

insert image description here
insert image description here

Finish:

insert image description here

Yanshen: Sometimes pip also encounters the same error that occurs when typing python. In most cases, the environment must be configured as above. When the environment is configured and pip is still not available, you need to update pip, command line:

python -m pip install --upgrade pip

result:

insert image description here

Guess you like

Origin blog.csdn.net/K_AAbb/article/details/127078508