' pip'未被认可

发布于 2025-01-29 14:42:40 字数 529 浏览 2 评论 0原文

我尝试安装pyside,但我从PowerShell中获得了以下内容的错误:

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

I tried to install PySide but I got error from the powershell 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

长梦不多时 2025-02-05 14:42:40

当一个人试图在命令提示符中使用PIP时,此错误显示在Windows上。
要在Windows上求解此错误,您必须通过以下步骤来声明路径变量:

  1. 右键单击我的计算机或此PC
  2. 单击属性,
  3. 单击高级系统设置,

您将找到一个称为系统变量的部分。
单击PATH从位于此处显示的变量列表和值。

单击路径单击编辑之后。您会在弹出窗口中找到一个新按钮。

单击那并粘贴python35python36文件夹(您在安装Python时指定的位置)的位置,然后是\ scripts

对我来说,它的c:\ users \ a610580 \ appdata \ local \ program \ python \ python \ python35-32
因此,我键入c:\ user \ a610580 \ appdata \ local \ program \ python \ python \ python35-32 \ scripts

单击ok ok 关闭所有Windows并重新命令提示符。

我重复 - 重新启动您的命令提示符。

现在一切都可以正常工作!
确保您不会在路径变量中打扰其他任何内容,并准确遵循上述步骤。

另外,您可以观看此视频

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:

  1. Right click on My Computer or This PC
  2. Click on Properties
  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.

箹锭⒈辈孓 2025-02-05 14:42:40

根据pip文档,而不是直接运行pip ,您只需要输入

py -m pip

Python终端即可。然后,您将看到您可以做的事情列表。

According to the pip documentation, rather than running pip directly, you just need to type

py -m pip

in your Python terminal. Then you will see a list of things you can do.

screenshot of IDE terminal showing the output

寂寞美少年 2025-02-05 14:42:40

这是因为pip.exe不在您的系统路径变量中的路径,因此CMD找不到PIP一个简单的修复程序将是更改为pip.exe ,如果从那里开始运行

cd C:\Python27\Scripts

,但是更好的解决方案是将其添加到您的路径变量中。打开命令提示符带有管理权和运行

setx path "%PATH%;C:\Python27\Scripts;"

将Python添加到您的路径中,您可以通过运行来检查路径变量中的路径列表,

echo %path%

您应该在那里看到新添加的路径。完成后,不要忘记重新命令提示。

现在您应该能够运行PIP。

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 "%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.

三岁铭 2025-02-05 14:42:40

基本上,您需要将PIP安装的路径添加到路径系统变量中。

第一个选项

通过修改Pyton安装来下载PIP。

步骤1-打开应用程序&功能

步骤2-查找python并单击

步骤3-按修改

步骤4-选择 pip

步骤5-选择<代码>将Python添加到环境变量并安装所有

将安装 pip 并同时添加 python pip

第二选项

默认情况下, pip c:\ python34 \ scripts \ pip

中安装在您的路径变量遵循该步骤。

步骤1-搜索环境变量并打开编辑系统环境变量

步骤2-开放环境变量...

步骤3-查找您的path变量和选择编辑

步骤4-将位置粘贴到您的 pip 安装(默认情况下,它是c:\ python34 \ scripts \ pip

Basiclly, You need to add the path of your pip installation to your PATH system variable.

First Option

Download pip by modifying the Pyton Installation.

Step 1 - Open Apps & Features

Step 2 - Find Python and click on it

Step 3 - Press Modify

Step 4 - Select pip

Step 5 - Select Add Python to environment variables and install everything

This will install pip and add both, Python and pip to your envirnoment variables.

Second Option

By default, pip is installed in C:\Python34\Scripts\pip

To add the path of your pip installation to your PATH variable follow theese steps.

Step 1 - Search for environment variables and open Edit the system environment variables

Step 2 - Open Environment Variables...

Step 3 - Find your PATH variable and select Edit

Step 4 - Paste the location to your pip installation (By default, it's C:\Python34\Scripts\pip)

人│生佛魔见 2025-02-05 14:42:40

安装Python 3.10.4前一段时间后,由于相同的错误消息,我无法使用PIP。似乎在安装Python时出现了问题,或者我忘了将Python添加到Windows路径中。
长话短说:

  • 我卸载了Python选择“卸载”选项,如下所示。

  • 我重新安装 Python 3.10 使用相同的.EXE安装程序。

  • 我确保我选择了“将python添加到路径”。单击“安装Python”后,您可能会在安装窗口的底部找到它。

pip之后的运行良好。

After installing Python 3.10.4 a while ago I was unable to use pip due to the same error message. It seems like that something had gone wrong while installing Python or I had forgotten to add Python to Windows PATH.
Long story short:

  • I uninstalled python choosing 'Uninstall' option as shown below. enter image description here

  • I reinstalled Python 3.10 using the same .exe installer.

  • I made sure I had selected the option "Add python to PATH". You will probably find it at the bottom of the installation windows after clicking "Install Python".
    enter image description here

Pip worked perfectly fine after this.

梦中楼上月下 2025-02-05 14:42:40

只需重新安装Python,然后单击安装程序中的添加到路径!

Just reinstall python and click add to PATH in the installer!

沉溺在你眼里的海 2025-02-05 14:42:40

我发现使用PowerShell PIP尚未识别,但是在CMD中是。

确保您实际上使用CMD而不是PowerShell来运行它。

I discovered that using powershell PIP wasn't recognized, but in the CMD it is.

Make sure you're actually using the cmd and not powershell to run it.

落花浅忆 2025-02-05 14:42:40

尝试一下。它对我安装另一个库:

  1. 通过以下方法之一打开CMD作为管理员:

方法1:

  • 打开启动菜单并搜索“ CMD”
  • 右键单击并选择“作为管理员

方法2:

  • 从键盘开始:” Windows:键+r“
  • type“ cmd”,然后按“ ctrl+shift+enter”
  1. 类型“ cd \”,然后按“ enter”

  2. 找到您的Python应用程序路径,该路径是您最初安装Python的文件夹。就我而言,Python应用程序路径是:

    c:\ users \ admin \ appdata \ local \ program \ python \ python38

  3. 然后键入“ cd”,然后按此路径,然后按Enter:< /p>

      cd C:\ Users \ Admin \ AppData \ Local \ Programs \ Python \ Python38
     
  4. 您应该获得以下结果

      c:\ users \ admin \ appdata \ local \ program \ python \ python38&gt;
     
  5. 写下python命令,然后按Enter,例如:

      c:\ users \ admin \ appdata \ local \ program \ python \ python \ python38&gt; python -m pip pip install -u pysine -u pyside
     

Try this. It worked for me installing another library:

  1. Open the CMD as Administrator by one of the following methods:

Method 1:

  • Open Start menu and search for "CMD"
  • Right click and choose "Run as Administrator

Method 2:

  • Press from the keyboard: "Windows Key + R"
  • Type "cmd" and Press "Ctrl+Shift+Enter"
  1. Type “cd\” and press "Enter"

  2. Locate your Python application path, which is the folder where you originally installed Python. In my case, the Python application path is:

    C:\Users\Admin\AppData\Local\Programs\Python\Python38

  3. Then type "cd" followed by this path and press enter:

    cd C:\Users\Admin\AppData\Local\Programs\Python\Python38
    
  4. You should get the following result

    C:\Users\Admin\AppData\Local\Programs\Python\Python38>
    
  5. Write your python command now and press enter, for example:

    C:\Users\Admin\AppData\Local\Programs\Python\Python38>python -m pip install -U PySide
    
人心善变 2025-02-05 14:42:40

这项工作给我
通过修改Python安装来下载PIP。

步骤1-打开应用程序&amp;功能
步骤2-查找Python并单击它
步骤3-按修改
步骤4-选择PIP
步骤5-选择将Python添加到环境变量中,然后安装所有内容

这将安装PIP并将Python和Pip同时添加到您的环境变量中。

This work for me,
Download pip by modifying the Python Installation.

Step 1 - Open Apps & Features
Step 2 - Find Python and click on it
Step 3 - Press Modify
Step 4 - Select pip
Step 5 - Select Add Python to environment variables and install everything

This will install pip and add both, Python and pip to your environment variables.

桜花祭 2025-02-05 14:42:40

然后,删除/卸载,python的旧版本,然后转到新版本的路径 - c:\ users \ apprandator \ appdata \ local \ program \ program \ python \ python \ python310(基本上,当您在此安装Python时是默认路径)

  1. 复制上述路径。
  2. 转到此PC Advance系统设置,转到环境变量,单击路径,单击新的,然后粘贴上述路径。
  3. c:\ users \ indercancer \ appdata \ local \ program \ python \ python310 \ scripts
    也添加此路径,然后还可以。

Delete/uninstall, the old version of Python then, go to the path of the new version - C:\Users\Administrator\AppData\Local\Programs\Python\Python310 (Basically when you install python this is the default path)

  1. Copy the above path.
  2. Go to This pc advance system setting , go to environment variables , click on path ,click on new then paste the above path.
  3. C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts
    add this path too and then ok.
谎言月老 2025-02-05 14:42:40

在Windows上:

1-确保安装了Python的位置,您可以通过使用以下内容获取Python的当前路径:

python -c "import os, sys; print(os.path.dirname(sys.executable))"

python3 -c "import os, sys; print(os.path.dirname(sys.executable))"

输出(例如):

C:\Users\user\AppData\Local\Programs\Python\Python39

现在转到该路径并访问“脚本”文件夹,并检查是否“ pip.exe”或“ pip3.exe”在那里,如果不尝试使用以下命令来修复它并通过cmd安装:

python -m ensurepip --upgrade

python3 -m ensurepip --upgrade

再次检查,如果“ pip.exe”或“ pip3.exe”在那里,如果是,请转到下一步,如果不尝试再次重新安装Python(然后在安装向导中单击PIP复选框)。

2-转到您的“环境变量” ==&gt; “系统变量”,然后单击“路径”
并添加拖车路径(在上面提取时):

C:\Users\user\AppData\Local\Programs\Python\Python39
C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts

3-转到“环境变量” ==&gt; “用于'您的用户名'”的“用户变量”,然后单击“路径”并添加拖车路径(在上面提取时):

C:\Users\user\AppData\Local\Programs\Python\Python39
C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts

4-关闭并重新打开CMD,然后尝试键入“ pip或pip3”

5-如果每件事很好尝试通过以下命令升级PIP版本:

 python -m pip install --upgrade pip

 python -m pip install --upgrade pip --user

完成。

on windows:

1- make sure where is your python are installed , you can get the current path of python by using the following :

python -c "import os, sys; print(os.path.dirname(sys.executable))"

or

python3 -c "import os, sys; print(os.path.dirname(sys.executable))"

output (for example):

C:\Users\user\AppData\Local\Programs\Python\Python39

now go to that path and access the "Scripts" folder , and check if "pip.exe" or "pip3.exe" are there , if not try to use the following command to fix it and install it by cmd:

python -m ensurepip --upgrade

or

python3 -m ensurepip --upgrade

check again , if "pip.exe" or "pip3.exe" are there, if yes go to next step , if not try to reinstall python again (and click on pip checkbox in your Installation Wizard ) .

2- go to your "environment variables" ==> "system variables" and then click on "path"
and add tow paths (as you extract it above) :

C:\Users\user\AppData\Local\Programs\Python\Python39
C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts

3- go to your "environment variables" ==> "user variables for 'your username' " and then click on "path" and add tow paths (as you extract it above) :

C:\Users\user\AppData\Local\Programs\Python\Python39
C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts

4- close and reopen your CMD again and try to type "pip or pip3"

5- if every thing fine try to upgrade your pip version by the following command:

 python -m pip install --upgrade pip

or

 python -m pip install --upgrade pip --user

done.

帅气尐潴 2025-02-05 14:42:40

如果第一个解决方案不起作用,请注意您的路径,没有一个机会而不是写作:

c:\ users \\ appdata \ local \ program \ python \ python \ python38-32

您写

c:/user/a610580/appdata/local/program/python/python/python38-32

如果您无法执行pip pip pip install selplast selenium在Visual Studio上靠近并打开视觉工作室。

In case the first solution didn't work, give attention to your path, there is a slight chance instead of writing :

C:\Users\\AppData\Local\Programs\Python\Python38-32

you wrote

C:/Users/a610580/AppData/Local/Programs/Python/Python38-32

if you couldn't execute pip install selenium on visual studio write it on cmd first the close and open your visual studio.

痴情换悲伤 2025-02-05 14:42:40

如果您已经正确设置了路径并仍会遇到相同的错误,请按照以下操作:

  1. 打开VS代码并创建一个新项目,然后从此链接-https://bootstrap.pypa.io/get-pip复制所有代码。
  2. PIP将在您创建的位置下载已
  3. 为您的主Python文件夹的VS代码复制get-pip.py设置路径。
  4. 你很好。

if you have already set the path correctly and still getting the same error then just follow this:

  1. open your vs code and create a new project and copy all the code from this link -https://bootstrap.pypa.io/get-pip.py
  2. Name this project as get-pip.py and run the code in vs code.
  3. pip will get downloaded at the location where you create have set the path for saved projects of your vs code
  4. Copy get-pip.py into your main python folder.
  5. You are good to go.
天暗了我发光 2025-02-05 14:42:40

只需转到python root文件夹,例如\ python38-32,然后进入\ scripts subfolder,其中包含pip.exe。您可以从那里完美安装。但是,为了避免再递归通过许多文件,您应该按照上述答案重置路径变量。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文