'pip' is not recognized

2020-02-11 08:25发布

I tried to install PySide but I got error from the power shell as follows:

pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
+ pip install -U PySide
+ ~~~
+ CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

3条回答
看我几分像从前
2楼-- · 2020-02-11 08:51

simply go to python root folder like \python38-32 and then go into \Scripts subfolder where contains pip.exe. You can install flawlessly from there. However, to avoid another time recursively go through many files, you should reset the PATH variable as the above answer mentioned.

查看更多
姐就是有狂的资本
3楼-- · 2020-02-11 09:04

That's because the path where pip.exe is, is not in your system PATH variable so cmd can't find pip a simple fix will be to change to the directory where pip.exe and run if from there like this

cd C:\Python27\Scripts

But a better solution is to add it to your PATH variable. Open Command prompt with admin rights and run

setx path "C:\Python27\Scripts;"

that adds python to your PATH, you can check the lists of paths in your path variable by running

echo %path%

You should see your newly added path there. Don't forget to restart command prompt after you're done.

Now you should be able to run pip.

查看更多
Luminary・发光体
4楼-- · 2020-02-11 09:04

This error shows up on windows when one tries to use pip in the command prompt. To solve this error on windows, you must declare path variable by following these steps:

Step 1 - Right click on My Computer or This PC
Step 2 - Click on Properties
Step 3 - Click on Advanced System Settings

You will find a section called system variables.
Click on Path from the list of variable and values that shows up there.
After clicking on path click edit. You will find a New button in the pop up.
Click that and paste the location of the python35 or python36 folder (The location you specified while installing python) followed by “\Scripts” there.
For me its “C:\Users\a610580\AppData\Local\Programs\Python\Python35-32”
so I type “C:\Users\a610580\AppData\Local\Programs\Python\Python35-32\Scripts”
Click Ok to close all windows and restart your command prompt.
I repeat - restart your command prompt.

Everything should now be working fine! Make sure you don’t disturb anything else in the path variable and follow the aforementioned steps exactly. Alternatively you can watch this video - https://www.youtube.com/watch?v=Jw_MuM2BOuI Happy coding!

查看更多
登录 后发表回答