简体   繁体   English

适用于 Windows 的 Python 3.8 中不存在 PIP

[英]PIP not present in Python 3.8 for Windows

I read in the PyPa pip documentation that pip comes with Python versions above 3.4 .我在 PyPa pip 文档中读到 pip 随 Python 版本高于 3.4 一起提供。 Meanwhile when I run the 'pip help' command on my command prompt it gives me the message below:同时,当我在命令提示符下运行“pip help”命令时,它给了我以下消息:

'pip' is not recognized as an internal or external command,
operable program or batch file.

I tried executing a suggested command from a response to a similar question yielding this:我尝试从对类似问题的响应中执行建议的命令,结果如下:

Looking in links: c:\Users\Public\Documents\Wondershare\CreatorTemp\tmpdgjv05zc
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-19.2.3 setuptools-41.2.0

I ran 'pip' help again yet again it gave me the same tone-deaf message我再次运行“pip”帮助它给了我同样的音盲信息

'pip' is not recognized as an internal or external command,
    operable program or batch file.

I can run Python files and 'py --version' gives me the version of Python I'm using.我可以运行 Python 文件,'py --version' 为我提供了我正在使用的 Python 版本。 I also tried placing the 'get-pip.py' file in a folder and getting to it through command prompt.我还尝试将“get-pip.py”文件放在一个文件夹中并通过命令提示符访问它。 Then I executed these commands然后我执行了这些命令

C:\Users\User\Desktop\pyt>python get-pip.py

C:\Users\User\Desktop\pyt>py get-pip.py

C:\Users\User\Desktop\pyt>python3 get-pip.py

They were executed immediately one-after-another but now no messages appear on the screen .他们立即一个接一个地被执行,但现在屏幕上没有显示任何消息。 Instead the OS goes to the next line, ignoring my command as if I didn't already execute one.相反,操作系统转到下一行,忽略我的命令,就好像我还没有执行过一样。

Why is it that I don't have pip installed?为什么我没有安装pip? How can I install it?我该如何安装?

Likely you didn't add your python installation to your path ( here's a how-to guide if you've never done this before ).可能您没有将 python 安装添加到您的路径中( 如果您以前从未这样做过,这里是一个操作指南)。 If you are on windows then add %USERPROFILE%\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\ to your path.如果您在 Windows 上,请将%USERPROFILE%\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\到您的路径中。 Change the 38 to whichever point release you installed (so if you installed python 3.7 then it would be 37 etc.).将 38 更改为您安装的任何版本(因此,如果您安装了 python 3.7,那么它将是 37 等)。

Typically, when installing Python, if you add it to the PATH system environment variable, both the Python3x (containing the Python executable) and the Python3x\\Scripts (containing pip) folders will be added to your path.通常,在安装 Python 时,如果将其添加到PATH系统环境变量中, Python3x (包含 Python 可执行文件)和Python3x\\Scripts (包含 pip)文件夹都会添加到您的路径中。

Apparently, something has happened to your path causing only the first of those two to be on the path.显然,你的路径发生了一些事情,导致只有这两个中的第一个在路径上。

Check which Python is on the path by running where python from the command line.通过从命令行运行where python来检查路径上是哪个 Python。 If that's the version of Python you expect to be using, add the Scripts folder for the same version to the path as well.如果这是您希望使用的 Python 版本,请将相同版本的Scripts文件夹也添加到路径中。

Alternatively, uninstall your version of Python and then reinstall, ensuring you check it so it adds Python to the PATH - at the end of the Windows installation, there's the option to lift PATH length restrictions, which may be your issue.或者,卸载您的 Python 版本,然后重新安装,确保您检查它以便将 Python 添加到PATH - 在 Windows 安装结束时,可以选择解除PATH长度限制,这可能是您的问题。

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

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