可以在VS代码中使用更新PIP。说{Update'update'}
OS:Win10
环境:Visual Studio代码
我要实现的目标:更新PIP从22.0.4到22.1
我尝试并获得的内容:
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安装 - 升级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"
- 检查python是否安装在此位置:
py -3 - version
获取:
Python 3.10.4
- 检查是否在此位置安装了PIP:
pip -version
获取
> pip 22.0.4 from
> C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\pip
> (python 3.10)
- 使用“ python3”而不是“ 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`
问题:我无法在VS代码中更新PIP,我还应该尝试或检查什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你真的很近。根据您的错误,这应该有效:
或
确保在管理员命令提示符中运行此操作。右键单击CMD,然后选择“作为管理员运行”。这将避免权限错误。
为什么您的其他选项不起作用
Python -M PIP Install -– -upgrade Pip
:由于Python的安装为py -3
而不是python。sudo pip3 install -upgrade pip
。 sudo是linux唯一命令pip Update
。更新不是PIP命令。您为什么不在此处使用安装-Upgrade Pip
?该错误显示PIP已安装并称为PIP,因此可以正常工作。Python3 -M PIP安装 - - 杯pip
。 python也不称为python3
,而是py -3
。总体而言,py -x
语法是在Windows上获取Python的最可靠方法。什么是
py -3
py -3
是找到Python的Windows实用程序。它的通用性非常多,例如,您可以键入py -3.9
才能获得专门的3.9版本。You are really close. Based on your errors this should work:
Or
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 -3
not 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 pip
here? The error shows pip is installed and called pip so that would work.python3 -m pip install -–upgrade pip
. Python isn't calledpython3
either, butpy -3
. Overall thepy -x
syntax 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 typepy -3.9
to get specifically the 3.9 version.如果在Linux上,如果在Windows或终端上,您可以尝试使用CMD/PowerShell。只需粘贴相同的命令,并尝试它
希望
如果它不起作用,我认为您还没有将Python/pip添加到路径上。
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.
我建议为此尝试CMD,如果仍然不起作用,请尝试在系统变量中添加Python路径。如果您不知道如何在这里为您做一个教程: https:// https:// .makeuseof.com/python-windows-path/
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/