Abstract :pip Not an internal or external command , Nor is it how mysterious a runnable program or batch file is ?
This article is shared from Huawei cloud community 《 uncover 「pip Not an internal or external command , Nor are they runnable programs or batch files 」 The veil of mystery 》, author :AXYZdong.
Preface
pip Not an internal or external command , Nor are they runnable programs or batch files How mysterious it is ?
Don't experience it , How do you know ? Bloggers have recently experienced .
Originally wanted to use pip install How many bags , Then it reminded me pip The package needs to be updated , I'll update it , But after the update , Reuse pip install The following will happen when :

One 、 Uncover the mystery
1、Scripts Folder not added to environment variable
【 resolvent 】
1. Find yourself python Installation directory
Bloggers : C:\Users\24144\AppData\Local\Programs\Python

2. Add environment variables
As shown in the figure , As long as Python Under folder Scripts Add the folder to the path environment variable and refer to its screenshot , To add the corresponding environment variable : C:\Users\24144\AppData\Local\Programs\Python\ Scripts To Path Go to... In environment variable , Because the change path contains the corresponding PIP Program , So it's easy to solve PIP Unable to run the problem. Right click : This computer - > attribute - > Advanced system setup - > senior - > environment variable - > route - > modify , After adding successfully, you can run .

Actually in Python The installation interface of will Python Options added to environment variables

2、Scripts Nothing in the folder pip package
Be sure to look under the installation directory Scripts Is there any in the folder pip package
If not ,win + R , open cmd command , Input
easy_install pip
You can reinstall .
Bloggers are updating pip after ,Scripts There is no... In the folder pip It's packed .
After installation Scripts It should be like this in the folder :

attach :pip Package download address :https://pypi.org/project/pip/#downloads
Two 、 The story behind the veil
pip Possible problems with updates
Input pip install openpyxl, The update prompt appears ( notes :openpyxl It's a kind of bag )
C:\Users\24144\AppData\Local\Programs\Python\Python37\Scripts>pip install openpyxl Collecting openpyxl Using cached https://files.pythonhosted.org/packages/1c/5d/e9087edae37ed185e883c9ec727215caba8b4044a8111ff033ebad85e508/openpyxl-3.0.1.tar.gz Collecting jdcal (from openpyxl) Using cached https://files.pythonhosted.org/packages/f0/da/572cbc0bc582390480bbd7c4e93d14dc46079778ed915b505dc494b37c57/jdcal-1.4.1-py2.py3-none-any.whl Collecting et_xmlfile (from openpyxl) Using cached https://files.pythonhosted.org/packages/22/28/a99c42aea746e18382ad9fb36f64c1c1f04216f41797f2f0fa567da11388/et_xmlfile-1.0.1.tar.gz Installing collected packages: jdcal, et-xmlfile, openpyxl Running setup.py install for et-xmlfile ... done Running setup.py install for openpyxl ... done Successfully installed et-xmlfile-1.0.1 jdcal-1.4.1 openpyxl-3.0.1 WARNING: You are using pip version 19.2.3, however version 19.3.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Input pip install --upgrade pip
C:\Users\24144\AppData\Local\Programs\Python\Python37\Scripts>pip install --upgrade pip Collecting pip Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl Installing collected packages: pip Found existing installation: pip 19.2.3 Uninstalling pip-19.2.3: Successfully uninstalled pip-19.2.3 ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access denied .: 'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-uninstall-aj7beqe0\\pip.exe' Consider using the `--user` option or check the permissions.
Access denied , Input pip install --user --upgrade pip that will do
summary
use pip Install expansion pack , To go to pip Installation directory . Usually in python Of scripts Under the table of contents .
If you find that 「pip Not an internal or external command , Nor are they runnable programs or batch files 」 After this question , First check Scripts Is there any in the folder pip package , Look again Scripts Whether the folder has been added to the environment variable .
【 Expand 】:
No matter when , stay cmd In the :
Not an internal or external command , Nor is it an error in a runnable program or batch file
There is no corresponding executable program found , therefore :
1. There is really no executable program in the system itself \to→ Download or install such programs , Remember to make sure PATH Contains the corresponding path .
2. There is such a program , however PATH There is no corresponding path in the \to→ Add the corresponding path to PATH Then you can .
【 reference 】
[1]:https://blog.csdn.net/miss85246/article/details/81069276
[2]:https://blog.csdn.net/weixin_30375427/article/details/96542832
[3]:https://blog.csdn.net/weixin_45905909/article/details/103170453
Click to follow , The first time to learn about Huawei's new cloud technology ~








![[leetcode] small thinking of optimal division](/img/da/ea01225047158c9ca53ac1c585bcd9.jpg)