'Can't update pip in VS code. Says { unknown command "update"}
OS: Win10
Environment: Visual Studio code
What I want to achieve: Update pip from 22.0.4 to 22.1
What I tried and get:
python -m pip install -–upgrade pip
get:
python : The term 'python' 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
+ python -m pip install -–upgrade pip
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
sudo pip3 install --upgrade pip
get:
sudo : The term 'sudo' 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
+ sudo pip3 install --upgrade pip
+ ~~~~
+ FullyQualifiedErrorId : CommandNotFoundException
pip update
get:
ERROR: unknown command "update"
- check if python installed in this location:
py -3 --version
get:
Python 3.10.4
- check if pip installed in this location:
pip --version
get
> pip 22.0.4 from
> C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\pip
> (python 3.10)
- use "python3" instead of "python"
python3 -m pip install -–upgrade pip
get:
> > `python3 : The term 'python3' 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
> + python3 -m pip install -–upgrade pip
> + ~~~~~~~
> + CategoryInfo : ObjectNotFound: (python3:String) [], CommandNotFoundException
> + FullyQualifiedErrorId : CommandNotFoundException`
Problem: I can't update pip in VS code, what else should I try or check?
Solution 1:[1]
You are really close. Based on your errors this should work:
py -3 -m pip install --upgrade pip
Or
pip install --upgrade pip
Make sure to run this in a administrator command prompt. Right click cmd and select "run as administrator". This will avoid permission errors.
Why your other options don't work
python -m pip install -–upgrade pip: Doesn't work since python is installed aspy -3not as python.sudo pip3 install --upgrade pip. Sudo is a linux only commandpip update. update is not a pip command. Why didn't you just useinstall --upgrade piphere? The error shows pip is installed and called pip so that would work.python3 -m pip install -–upgrade pip. Python isn't calledpython3either, butpy -3. Overall thepy -xsyntax is the most reliable way to get python on windows.
What is py -3
py -3 is a windows utility that finds python. It's pretty versatile, for example you can type py -3.9 to get specifically the 3.9 version.
Solution 2:[2]
You can try to use a cmd/powershell if on windows or terminal if on linux. Just paste the same command and try it
Hope it helps
If it doesn't work i think that you haven't added python/pip to path.
Solution 3:[3]
I recommend trying CMD for that, if still not working, try adding your python path to the system variables. If you don't know how to do that here a tutorial for you: https://www.makeuseof.com/python-windows-path/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mousetail |
| Solution 2 | |
| Solution 3 |
