This article is shared by AXYZdong in huawei Cloud community. It reveals the mystery that PIP is not an internal or external command, nor a runnable program or batch file.
preface
How mysterious is PIP, which is not an internal or external command, a runnable program or batch file?
How do you know until you experience it? Bloggers recently got a taste of it.
PIP install: PIP install: PIP install: PIP install: PIP install: PIP install
PIP package download address: pypi.org/project/pip…
One, uncover the mystery
1. Scripts folder is not added to environment variables
【 Solution 】
1. Find your Python installation directory
C: Users\24144\AppData\Local\Programs\Python
2. Add environment variables
As shown in the figure, just add the Scripts folder in Python folder to the path environment variable and refer to the screenshot to add the corresponding environment variable: C: Users\24144\AppData\Local\Programs\Python\ Scripts This computer – > Properties – > Advanced System Settings – > Advanced – > Environment Variables – > Path – > Modify, add successful can run.
There is an option to add Python to environment variables on the Python installation screen
2. No PIP package exists in the Scripts folder
Be sure to look for PIP packages in the Scripts folder under the installation directory
If not, win + R, open CMD, and type
easy_install pip
Copy the code
You can reinstall it.
There is no PIP package in the Scripts folder after the blogger has updated PIP.
After the installation, the Scripts folder should look like this:
2. The Story behind the Veil
Possible problems with PIP updates
Type PIP install OpenPyXL and you will be prompted for an update.
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-p y2.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.Copy the code
Enter 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-py 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] Refuse access. : 'C:\\Users\\hp\\AppData\\Local\\Temp\\pip-uninstall-aj7beqe0\\pip.exe' Consider using the `--user` option or check the permissions.Copy the code
PIP install –user –upgrade PIP
conclusion
To install extensions with PIP, go to the PIP installation directory first. It’s usually in python scripts.
If PIP is not an internal or external command, or a runnable program or batch file, check for PIP packages in the Scripts folder, and then see if the Scripts folder has been added to the environment variable.
【 extension 】 :
Whenever this occurs in CMD:
It’s not an internal or external command, it’s not an error in a runnable program or a batch file, it’s not an executable found, so:
1. There is no executable program \to→ download or install this program, and make sure that PATH contains the corresponding PATH. 2. There is this program, but the PATH does not contain the corresponding PATH \to→ add the corresponding PATH to the PATH.
【 References 】
[1] : blog.csdn.net/miss85246/a…
[2] : blog.csdn.net/weixin_3037…
[3] : blog.csdn.net/weixin_4590…
Click to follow, the first time to learn about Huawei cloud fresh technology ~