简体   繁体   English

'pip' 未被识别为内部或外部命令

[英]'pip' is not recognized as an internal or external command

I'm running into a weird error when trying to install Django on my computer.尝试在我的计算机上安装 Django 时遇到一个奇怪的错误。

This is the sequence that I typed into my command line:这是我在命令行中输入的序列:

C:\Python34> python get-pip.py
Requirement already up-to-date: pip in c:\python34\lib\site-packages
Cleaning up...

C:\Python34> pip install Django
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Python34> lib\site-packages\pip install Django
'lib\site-packages\pip' is not recognized as an internal or external command,
operable program or batch file.

What could be causing this?这可能是什么原因造成的?

This is what I get when I type in echo %PATH% :这是我输入echo %PATH%时得到的:

C:\Python34>echo %PATH%
C:\Program Files\ImageMagick-6.8.8-Q16;C:\Program Files (x86)\Intel\iCLS Client\
;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\S
ystem32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\
Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Progr
am Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Mana
gement Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine C
omponents\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components
\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\P
rogram Files (x86)\nodejs\;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x
86)\git\cmd;C:\RailsInstaller\Ruby2.0.0\bin;C:\RailsInstaller\Git\cmd;C:\RailsIn
staller\Ruby1.9.3\bin;C:\Users\Javi\AppData\Roaming\npm

You need to add the path of your pip installation to your PATH system variable .您需要将 pip 安装路径添加到 PATH 系统变量中。 By default, pip is installed to C:\Python34\Scripts\pip (pip now comes bundled with new versions of python), so the path "C:\Python34\Scripts" needs to be added to your PATH variable.默认情况下,pip 安装到C:\Python34\Scripts\pip (pip 现在与新版本的 python 捆绑在一起),因此需要将路径“C:\Python34\Scripts”添加到 PATH 变量中。

To check if it is already in your PATH variable, type echo %PATH% at the CMD prompt要检查它是否已经在您的 PATH 变量中,请在 CMD 提示符下键入echo %PATH%

To add the path of your pip installation to your PATH variable , you can use the Control Panel or the setx command.要将 pip 安装的路径添加到 PATH 变量中,可以使用控制面板或setx命令。 For example:例如:

setx PATH "%PATH%;C:\Python34\Scripts"

Note : According to the official documentation , "[v]ariables set with setx variables are available in future command windows only, not in the current command window".注意:根据官方文档,“使用 setx 变量设置的 [v] 变量仅在未来的命令窗口中可用,在当前命令窗口中不可用”。 In particular, you will need to start a new cmd.exe instance after entering the above command in order to utilize the new environment variable.特别是,您需要在输入上述命令后启动一个新的 cmd.exe 实例,以利用新的环境变量。

Thanks to Scott Bartell for pointing this out.感谢 Scott Bartell 指出这一点。

对于 Windows,安装软件包时,请键入:

python -m pip install [packagename]

As of now, version 3.7.3 I had a little bit of an issue with getting the right system variable.截至目前,版本 3.7.3 我在获取正确的系统变量方面遇到了一点问题。

Try this:尝试这个:

  1. Type start %appdata% in cmd.在 cmd 中键入start %appdata%

  2. After that file explorer should pop up in ../AppData/Roaming .之后,文件资源管理器应该会在../AppData/Roaming中弹出。

Go back one directory and navigate to Local/Programs/Python/Python37-32/Scripts .返回一个目录并导航到Local/Programs/Python/Python37-32/Scripts

NOTE: The version number may be different so if you copy and paste the above file path it could not work.注意:版本号可能不同,因此如果您复制并粘贴上述文件路径,它将无法正常工作。

After you do this you now have the correct location of your downloaded Python.完成此操作后,您现在拥有下载的 Python 的正确位置。 Copy your file path by selecting the whole directory in the address bar.通过选择地址栏中的整个目录来复制文件路径。

在此处输入图像描述

Once you do that click the start icon and navigate to the Control PanelSystem and SecuritySystem .完成后,单击开始图标并导航到控制面板系统和安全系统 Then click "Advanced System Settings" on the left side of the panel.然后单击面板左侧的“高级系统设置”

Once there, click Environment Variables on the bottom right and there will be two boxes, an upper and a lower box.在那里,单击右下角的环境变量,将有两个框,一个上框和一个下框。 In the upper box: Click on the 'Path' Variable and click Edit located on the right.在上框中:单击“路径”变量,然后单击右侧的编辑 Click New and paste your directory Path.单击新建并粘贴您的目录路径。 It should look something like this:它应该看起来像这样:

在此处输入图像描述

Click OK three times, open a new window of cmd and type: pip .单击确定三次,打开一个的 cmd 窗口并输入: pip See if it works.看看它是否有效。

For me the command:对我来说命令:

set PATH=%PATH%;C:\Python34\Scripts

worked immediately (try after echo %PATH% and you will see that your path has the value C:\Python34\Scripts).立即工作(在echo %PATH%之后尝试,您将看到您的路径具有值 C:\Python34\Scripts)。

Thanks to: Adding a directory to the PATH environment variable in Windows感谢: 将目录添加到 Windows 中的 PATH 环境变量

Alternate way.另一种方式。

If you don't want to add the PATH as the previous well written answers pointed out,如果您不想像以前写得很好的答案指出的那样添加 PATH ,

but you want to execute pip as your command then you can do that with py -m as prefix.但是您想将 pip 作为命令执行,那么您可以使用py -m作为前缀来执行此操作。

Given that you have to do it again and again.鉴于您必须一次又一次地这样做。

eg.例如。

py -m <command>

as in如在

py -m pip install --upgrade pip setuptools

Also make sure to have pip and py installed还要确保安装了pippy

在此处输入图像描述

在我的 Windows 10 机器上工作的唯一方法如下:

py -3 -m pip install xxxxx

Also, the long method - it was a last resort after trying all previous answers:此外,长方法 - 这是尝试所有先前答案后的最后手段:

C:\python27\scripts\pip.exe install [package].whl

This after cd in directory where the wheel is located. cd 在轮子所在的目录中之后。

As per Python 3.6 Documentation根据Python 3.6 文档

It is possible that pip does not get installed by default.默认情况下可能没有安装 pip。 One potential fix is:一种可能的解决方法是:

python -m ensurepip --default-pip

Go to control Panel >> Uninstall or change Program and double click on Python XXX to modify install.转到控制面板>>卸载更改程序,然后双击Python XXX修改安装。 Make sure PIP component is checked and install.确保检查并安装 PIP 组件。

在此处输入图像描述

Control Panel -> add/remove programs -> Python -> Modify -> optional Features (you can click everything) then press next -> Check "Add python to environment variables" -> Install控制面板 -> 添加/删除程序 -> Python -> 修改 -> 可选功能(您可以单击所有内容)然后按下一步 -> 选中“将 python 添加到环境变量” -> 安装

在此处输入图像描述

And that should solve your path issues, so jump to command prompt and you can use pip now.这应该可以解决您的路径问题,因此请跳转到命令提示符,您现在可以使用 pip。

I was having the same problem just now.我刚才也有同样的问题。

After adding the proper folder ( C:\Python33\Scripts ) to the path, I still could not get pip to run.将正确的文件夹( C:\Python33\Scripts )添加到路径后,我仍然无法让pip运行。 All it took was running pip.exe install -package- instead of pip install -package- .只需要运行pip.exe install -package-而不是pip install -package-

尝试转到 Windows PowerShell 或 cmd 提示符并键入:

python -m pip install openpyxl

In latest version Python 3.6.2 and above, is available in在最新版本 Python 3.6.2 及更高版本中,可在

C:\Program Files (x86)\Python36-32\Scripts C:\Program 文件 (x86)\Python36-32\Scripts

You can add the path to our environment variable path as below您可以将路径添加到我们的环境变量路径,如下所示

在此处输入图像描述

Make sure you close your command prompt or Git after setting up your path.确保在设置路径后关闭命令提示符或 Git。 Also should you open your command prompt in administrator mode .您还应该在管理员模式下打开命令提示符 This is example for Windows 10.这是 Windows 10 的示例。

Use利用

set Path = `%PATH%;C:\Python34\;C:\Python27\Scripts`

Source资源

Or if you are using PyCharm (2017-03-03) like me, just change directory in terminal and install:或者,如果您像我一样使用PyCharm (2017-03-03),只需更改终端中的目录并安装:

cd C:\Users\{user}\PycharmProjects\test\venv\Scripts
pip install ..

Even I'm new to this, but pip install django worked for me.即使我是新手,但pip install django为我工作。

The path should be set as where the script folder of the Python installation is, ie C:\Python34\Scripts .路径应设置为 Python 安装的脚本文件夹所在的位置,即C:\Python34\Scripts

I suppose it's because Django is a framework which is based on Python, and that's why this directory structure has to be maintained while installing.我想这是因为 Django 是一个基于 Python 的框架,这就是为什么在安装时必须维护这个目录结构。

I have just installed Python 3.6.2.我刚刚安装了 Python 3.6.2。

I got the path as我得到了路径

C:\Users\USERNAME\AppData\Local\Programs\Python\Python36-32\Scripts C:\Users\USERNAME\AppData\Local\Programs\Python\Python36-32\Scripts

You can try pip3 .你可以试试pip3 Something like:就像是:

pip3 install pandas

Most frequently it is:最常见的是:

in cmd.exe writecmd.exe中写入

python -m pip install --user [name of your module here without brackets]

In Windows , open cmd and find the location of PYTHON_HOME using where python .在 Windows中,打开 cmd 并使用where python找到 PYTHON_HOME 的位置。 Now add this location to your environment variable PATH using:现在使用以下命令将此位置添加到您的环境变量 PATH 中:

set PATH=%PATH%;<PYTHON_HOME>\Scripts

Or refer to this .或者参考这个


In Linux , open a terminal and find the location of PYTHON_HOME using which python .在 Linux中,打开终端并使用which python找到 PYTHON_HOME 的位置。 Now add the PYTHON_HOME/Scripts to the PATH variable using:现在使用以下命令将PYTHON_HOME/Scripts添加到 PATH 变量中:

PATH=$PATH:<PYTHON_HOME>\Scripts
export PATH

I was facing the same issue.我面临着同样的问题。 Run Windows PowerShell as Administrator .管理员身份运行 Windows PowerShell。 It resolved my issue.它解决了我的问题。

在此处输入图像描述

None of these actually worked for me, but running这些实际上都不适合我,但是正在运行

python -m pip install -U pip

and then adding the specified directory to the PATH as suggested got it working然后按照建议将指定的目录添加到 PATH 使其正常工作

In your Python folder path in Terminal, just type在终端的 Python 文件夹路径中,只需键入

  py -m pip

in order to check the current version of your pip.为了检查您的 pip 的当前版本。 You will also see a list of commands, you can use...您还将看到一个命令列表,您可以使用...

在此处输入图像描述

I think from Python 2.7.9 and higher pip comes pre installed and it will be in your scripts folder.我认为 Python 2.7.9 和更高版本的 pip 是预安装的,它将位于您的脚本文件夹中。

So you have to add the "scripts" folder to the path.因此,您必须将“脚本”文件夹添加到路径中。 Mine is installed in C:\Python27\Scripts .我的安装在C:\Python27\Scripts中。 Check yours to see what your path is so that you can alter the below accordingly.检查您的路径以查看您的路径,以便您可以相应地更改以下内容。 Then go to PowerShell, paste the below code in PowerShell and hit Enter key.然后转到 PowerShell,将以下代码粘贴到 PowerShell 中并按Enter键。 After that, reboot and your issue will be resolved.之后,重新启动,您的问题将得到解决。

[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\Scripts", "User")

In a Windows environment, just execute the below commands in a DOS shell.在 Windows 环境中,只需在 DOS shell 中执行以下命令。

path=%path%;D:\Program Files\python3.6.4\Scripts;路径=%path%;D:\Program Files\python3.6.4\Scripts; (new path=current path;path of the Python script folder) (新路径=当前路径;Python 脚本文件夹的路径)

I deleted the older version using the control panel and then installed the new version however the newer version was not reflecting pip even after adding the right paths in the environment variables.我使用控制面板删除了旧版本,然后安装了新版本,但是即使在环境变量中添加了正确的路径,新版本也没有反映 pip。 However, the thing that worked for me was deleting the folders of old python that were there in the local App folder even after uninstall.但是,对我有用的是删除本地 App 文件夹中的旧 python 文件夹,即使在卸载后也是如此。 For me, the path was like below.对我来说,路径如下所示。 Deleting this folder solved my issue删除此文件夹解决了我的问题

C:\Users\username\AppData\Local\Programs\Python38

refer the ENV path setting up : http://www.pythoncentral.io/add-python-to-path-python-is-not-recognized-as-an-internal-or-external-command/ make sure the env path is added correctly, for 2.7-"c:\\Python27\\Scripts;" 请参阅ENV路径设置: http : //www.pythoncentral.io/add-python-to-path-python-is-not-recognized-as-an-internal-or-external-command/确保环境路径为2.7-“ c:\\ Python27 \\ Scripts”正确添加了

refer Get Pip section : http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/ 请参阅“获取Pip”部分: http : //www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/

make use of these resources.this will solve issue for you 利用这些资源。这将为您解决问题

Small clarification: in "Windows 7 64 bit PC", after adding ...Python34\Scripts to the path variable, pip install pygame didn't work for me.小说明:在“Windows 7 64 位 PC”中,将...Python34\Scripts添加到路径变量后, pip install pygame对我不起作用。

So I checked the "...Python34\Scripts" folder, it didn't have pip , but it had pip3 and pip3.4 .所以我检查了“...Python34\Scripts”文件夹,它没有pip ,但它有pip3pip3.4 So I ran pip3.4 install pygame .... .whl .所以我跑了pip3.4 install pygame .... .whl It worked.有效。

(Further open a command window in the same folder where you have the downloaded pygame...whl file.) (在您下载的pygame...whl文件所在的同一文件夹中进一步打开命令窗口。)

I continued to receive this error after correcting my PATH.更正我的 PATH 后,我继续收到此错误。

If your codebase requires that you have an earlier version of Python (2.7 in my case), it may have been a version prior to the existence of pip.如果您的代码库要求您拥有较早版本的 Python(在我的情况下为 2.7),则它可能是 pip 存在之前的版本。

It's not very canonical, but installing a more recent version worked for me.这不是很规范,但安装更新的版本对我有用。 (I used 2.7.13.) (我用的是 2.7.13。)

I had this same issue.我有同样的问题。 You just need to go to your你只需要去你的

C:\Python27\Scripts C:\Python27\脚本

and add it to environment variables.并将其添加到环境变量中。 After path setting just run pip.exe file on C:\Python27\Scripts and then try pip in cmd.路径设置后,只需在 C:\Python27\Scripts 上运行 pip.exe 文件,然后在 cmd 中尝试 pip。 But if nothing happens try running all pip applications like pip2.7 and pip2.exe.但如果没有任何反应,请尝试运行所有 pip 应用程序,如 pip2.7 和 pip2.exe。 And pip will work like a charm. pip 会像一个魅力一样工作。

A very simple way to get around this is to open the path where pip is installed in File Explorer , and click on the path, then type cmd, this sets the path, allowing you to install way easier.解决这个问题的一个非常简单的方法是在文件资源管理器中打开 pip 的安装路径,然后单击路径,然后键入 cmd,这将设置路径,让您更轻松地安装。

I ran into the same issue a couple days ago and all the other methods didn't work for me.几天前我遇到了同样的问题,所有其他方法都对我不起作用。

Try to uninstall Python, delete the remaining program files, and then install it again fresh.尝试卸载 Python,删除剩余的程序文件,然后重新安装。

It worked for me.它对我有用。 This error happened to me when I migrated to a new laptop and used a migration software to move my software from the old laptop to the new one.当我迁移到新笔记本电脑并使用迁移软件将我的软件从旧笔记本电脑移动到新笔记本电脑时,这个错误发生在我身上。 And yeah, it didn't work quite well.是的,它运行得不太好。

对我来说,问题是在 PATH 中添加以下内容后系统没有重新启动

C:\Users\admin\AppData\Local\Programs\Python\Python37\Scripts

When installing SQL 2019 Python, there are known issues for PIP which require a fix (step 7) https://docs.microsoft.com/en-us/sql/advanced-analytics/known-issues-for-sql-server-machine-learning-services?view=sql-server-ver15安装 SQL 2019 Python 时,PIP 存在需要修复的已知问题(步骤 7) https://docs.microsoft.com/en-us/sql/advanced-analytics/known-issues-for-sql-server-机器学习服务?view=sql-server-ver15

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用。

Workaround
Copy the following files:

libssl-1_1-x64.dll
libcrypto-1_1-x64.dll

from the folder 
C:\Program Files\Microsoft SQL Server\MSSSQL15.MSSQLSERVER\PYTHON_SERVICES\Library\bin
to the folder 
C:\Program Files\Microsoft SQL Server\MSSSQL15.MSSQLSERVER\PYTHON_SERVICES\DLLs

Then open a new DOS command shell prompt.

对于 Mac,在终端窗口中运行以下命令:

echo  export "PATH=$HOME/Library/Python/2.7/bin:$PATH"

So this error can we resolved very easily .所以这个错误我们可以很容易地解决。

First of all you have to check if the pip is installed or not with python .首先,您必须使用 python 检查是否安装了 pip。 For That you need to follow following method.为此,您需要遵循以下方法。

  1. open the python installation directory打开python安装目录

    pip in c:\python34\lib\site-packages\点在 c:\python34\lib\site-packages\

we supposes that you have installed python in c drive in python34 named folder.我们假设您已经在 python34 命名文件夹的 c 驱动器中安装了 python。 this will be definitely different for you .这对你来说肯定会有所不同。

  1. Under site-packages folder find pip folder .在 site-packages 文件夹下找到 pip 文件夹。 If it is, then all set, you just need to go for next step .如果是,则一切就绪,您只需要进行下一步即可。 If not Just refer to this tutorial to install it如果没有,请参考本教程进行安装

Now Pip is installed in our system and you just need to configure it.现在 Pip 已安装在我们的系统中,您只需要对其进行配置。

  1. Open the Python installation directory:打开Python安装目录:

Here copy the path of installation directory ex :这里复制安装目录 ex 的路径:

C:\python38;
C:\python38\Scripts;

Here i am assuming that python is installed under C:\python38 directory.这里我假设 python 安装在 C:\python38 目录下。 Please change accordingly.请相应更改。

  1. Now In windows Click on start Button and search :现在在 Windows 中单击开始按钮并搜索:

    Environment Variable环境变量

3.Open edit the system environment Variable option. 3.打开编辑系统环境变量选项。

  1. Under User variable choose Path and open it by clicking .在用户变量下选择路径并通过单击打开它。

  2. Now click on add new and just add above copied path one by one .现在单击添加新的,只需将上面复制的路径一一添加。

  3. save it and close all tabs .保存并关闭所有选项卡。

  4. Open cmd and type打开cmd并输入

    pip -V点-V

     PS C:\Users\pro> pip -V pip 20.2.3 from c:\python38\lib\site-packages\pip (python 3.8)

Now Its Work.现在它的工作。

Having Issue Let me know.有问题让我知道。

For Python 2.7: Just use this command in Command Prompt [Run as administrator]:对于 Python 2.7:只需在命令提示符 [以管理员身份运行] 中使用此命令:

mklink /H pip.exe c:\python27\Scripts\pip.exe

Result: Hardlink created for pip.exe <<===>> c:\python27\Scripts\pip.exe结果:为 pip.exe <<===>> c:\python27\Scripts\pip.exe 创建硬链接

And...done :)并做了 :)

First of all, check the pip version, and its existence on machine首先,检查pip版本,以及它在机器上是否存在

 pip --version

or或者

 pip3 --version

If you in case pip is not installed then install it.如果您在未安装pip的情况下,请安装它。

On Linux, you can install pip3 by running an apt-get command in your terminal.在 Linux 上,您可以通过在终端中运行 apt-get 命令来安装 pip3。

sudo apt-get -y install python3-pip

On Mac, pip is bundled with the Python distributable, so you need to re-install Python在 Mac 上,pip 与 Python 分发包捆绑在一起,因此您需要重新安装 Python

brew uninstall --ignore-dependencies python3 && brew install python3

On window this issue occurs when pip is not correct in the PATH file在窗口中,当 PATH 文件中的pip不正确时,会出现此问题

You can try below py prefix alternative to make it work您可以尝试以下py前缀替代方案以使其工作

python -m pip install [packagename]

To set pip PATH [Reffer to Ani Menon Answer for details]设置pip PATH [详情请参考 Ani Menon Answer]

Find the location of PYTHON_HOME using使用查找 PYTHON_HOME 的位置

where python

Now add this location to your environment variable PATH using现在将此位置添加到您的环境变量 PATH 使用

set PATH=%PATH%;<PYTHON_HOME>\Scripts

Or或者

On Linux, open a terminal and find the location of PYTHON_HOME using在 Linux 上,打开终端并使用以下命令找到 PYTHON_HOME 的位置

which python

Now add the PYTHON_HOME/Scripts to the PATH variable using:现在使用以下命令将PYTHON_HOME/Scripts添加到 PATH 变量中:

PATH=$PATH:<PYTHON_HOME>\Scripts
export PATH

'pip' is not recognized as an internal or external command 'pip'未被识别为内部或外部命令

pip is a python module used to install packages. pip 是一个 python 模块,用于安装包。 For your problem, there can be many reasons;对于您的问题,可能有很多原因;

  • Restart CMD/Terminal重启 CMD/终端
  • Environment variable is not set.未设置环境变量。 pip is installed but environment variable is not set. pip 已安装,但未设置环境变量。 Environment variable is a windows variable where pip path is saved, so it can be run at run time.环境变量是一个 windows 变量,其中保存了 pip 路径,因此可以在运行时运行。
  • pip is not installed. pip 未安装。

Restart CMD/Terminal重启 CMD/终端

It is sometimes possible that you opened your command prompt or terminal before installing pip and now it just needs a restart to pick up the latest environment variables.有时您可能在安装 pip 之前打开了命令提示符或终端,现在只需重新启动即可获取最新的环境变量。 It is worth trying just restarting your command prompt or terminal.值得尝试重新启动命令提示符或终端。

Environment Variable is Not Set未设置环境变量

Open CMD and run this command to see the values set in the PATH environment variable.打开 CMD 并运行此命令以查看 PATH 环境变量中设置的值。

echo %PATH%

This will echo the PATH environment variable like this;这将像这样回显 PATH 环境变量; 在此处输入图像描述

You should check if your path exist in the echoed PATH list.您应该检查您的路径是否存在于回显的 PATH 列表中。 For example, in my case, the path for pip.exe files is C:\Python310\Scripts .例如,在我的例子中, pip.exe 文件的路径是C:\Python310\Scripts You can check this path yourself like this;您可以像这样自己检查这条路径; 在此处输入图像描述

If you can find pip path and it does not exist the echoed PATH variable, then we need to add it.如果你能找到 pip 路径并且它不存在 echoed PATH 变量,那么我们需要添加它。 Copy the path like C:\Python310\Scripts .复制路径,如C:\Python310\Scripts

Go to Start > This PC > Properties > Advance system settings > Advanced > Environment Variables Go 开始 > 这台电脑 > 属性 > 高级系统设置 > 高级 > 环境变量

在此处输入图像描述

As shown in the image above, Select Path, click Edit button and add the copied path.如上图,Select 路径,点击编辑按钮,添加复制的路径。 Restart the CMD and test pip command again.重新启动 CMD 并再次测试 pip 命令。

pip is Not Installed pip 未安装

If pip is not installed, you can install it again by downloading latest python.exe setup from python.org website.如果 pip 未安装,您可以通过从 python.org 网站下载最新的python.exe安装程序重新安装。 Make sure you check mark the pip option as shown in the image below.确保选中 pip 选项,如下图所示。 在此处输入图像描述

In the next step, check mark "Add Python to environment variables"在下一步中,勾选“将 Python 添加到环境变量” 在此处输入图像描述

If you are working with Python, eg PyCharm , you should install the library to the Python library path like this:如果您正在使用 Python,例如PyCharm ,您应该将库安装到 Python 库路径,如下所示:

pip install --target=C:\Users\<...>\lib <Library-Name>

real eg真实的例如

pip install --target=C:\Users\devel\AppData\Local\Programs\Python\Python36\Lib requests <br>

PS: If you want to check if it's installed, PS:如果要检查是否安装,

<Library-Name> --version

will not work correctly.将无法正常工作。

暂无
暂无

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

相关问题 无法解决“ pip”问题的方法未被识别为内部或外部命令 - No way to fix 'pip' is not recognized as an internal or external command Python 2.7 &#39;Pip&#39; 不被识别为内部或外部命令 - Python 2.7 'Pip' is not recognized as an internal or external command pip 在 windows7 中未被识别为内部或外部命令 - pip is not recognized as an internal or external command in windows7 &#39;pip2&#39; 未被识别为内部或外部命令 - 'pip2' is not recognized as an internal or external command 在Windows 7上安装TensorFlow - &#39;pip3&#39;不被识别为内部或外部命令, - Installation of TensorFlow on windows 7 - 'pip3' is not recognized as an internal or external command, pip 不是内部或外部命令,也不是可运行的程序或批处理文件 - pip is not recognized as an internal or external command, operable program or batch file 点不被识别为内部或外部命令(即使添加了PATH变量之后) - Pip not recognized as internal or external command (even after adding PATH variables) 'pip' 不是内部或外部命令、可运行程序或批处理 - 'pip' is not recognized as an internal or external command, operable program or batch &#39;pip3&#39; 不是内部或外部命令,也不是可运行的程序或批处理文件 - 'pip3' is not recognized as an internal or external command, operable program or batch file &#39;pip&#39;不被识别为内部或外部命令,可操作程序或批处理文件 - 'pip' is not recognized as an internal or external command, operable program or batch file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM