简体   繁体   English

pip 尝试安装软件包时出错 Python 3.10

[英]pip giving error when trying to install packages Python 3.10

I have been having issues with pip on Python 3.10 attempting to install a package gives me the following error我在 Python 3.10 上遇到 pip 的问题,尝试安装 package 时出现以下错误

pip: The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. pip:术语“pip”未被识别为 cmdlet、function、脚本文件或可运行程序的名称。 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在行:1 字符:1

I have tried reinstalling pip and I have also tried reinstalling python.我尝试过重新安装 pip 并且我也尝试过重新安装 python。

This error shows up on windows when one tries to use pip in the command prompt.当尝试在命令提示符中使用 pip 时,此错误会出现在 windows 上。 To solve this error on windows, you must declare path variable by following these steps:要解决 windows 上的此错误,您必须按照以下步骤声明路径变量:

Step 1 - Right click on My Computer or This PC Step 2 - Click on Properties Step 3 - Click on Advanced System Settings第 1 步 - 右键单击我的电脑或此 PC 第 2 步 - 单击属性 第 3 步 - 单击高级系统设置

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.单击它并粘贴 python35 或 python36 文件夹的位置(您在安装 python 时指定的位置),然后在此处粘贴“\Scripts”。

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.对我来说,它是“C:\Users\a610580\AppData\Local\Programs\Python\Python35-32”,所以我输入“C:\Users\a610580\AppData\Local\Programs\Python\Python35-32\Scripts”点击确定关闭所有 windows 并重新启动命令提示符。

I repeat - restart your command prompt.我重复一遍 - 重新启动您的命令提示符。

This error is given by Windows, saying that pip is not found.这个错误是由Windows给出的,说没有找到pip。 It happened because Python isn't in your shell path, If you just installed Python, logout your user and log back in see if it resolves, if not, Python is not in your PATH. It happened because Python isn't in your shell path, If you just installed Python, logout your user and log back in see if it resolves, if not, Python is not in your PATH.

For me, the most convenient way is reinstalling Python and checking every checkbox that says something like "Add python to PATH/environment variable" in the installer.对我来说,最方便的方法是重新安装 Python 并检查安装程序中每个显示“将 python 添加到 PATH/环境变量”之类的复选框。 You can also follow the other answer to add PATH manually.您也可以按照其他答案手动添加 PATH 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM