简体   繁体   English

我的电脑无法在 Python 3.8 上安装 pip

[英]My computer can not install pip on Python 3.8

I use Python 3.8.5 on Windows 10 but I still don't have pip attached with Python.我在 Windows 10 上使用 Python 3.8.5,但我仍然没有用 Python 附加 pip。 I test with this我用这个测试

pip --version

I have followed the instruction in https://pip.pypa.io/en/stable/installing/ but my computer just do nothing after I type in我已按照https://pip.pypa.io/en/stable/installing/ 中的说明进行操作,但我的计算机在输入后什么也不做

python get-pip.py

Nothing appears, no error, no instruction and now I just don't know what to do to install pip.什么都没有出现,没有错误,没有说明,现在我只是不知道如何安装 pip。 I found nobody having the same this error.我发现没有人有同样的错误。

  1. Download the get-pip file from this link.从此链接下载 get-pip 文件。 https://bootstrap.pypa.io/get-pip.py https://bootstrap.pypa.io/get-pip.py
  2. Change the current path of the directory in the command line to the path of the directory where the above file exists.将命令行中目录的当前路径更改为上述文件所在目录的路径。
  3. Run the command : python get-pip.py运行命令: python get-pip.py
  4. One can easily verify if the pip has been installed correctly by performing a version check on the same.通过对 pip 执行版本检查,可以轻松验证 pip 是否已正确安装。 Just go to the command line and execute pip -V只需转到命令行并执行pip -V
  5. If still not working then edit the path variable in settings.如果仍然不起作用,请在设置中编辑路径变量。 ref link.参考链接。 'pip' is not recognized as an internal or external command 'pip' 未被识别为内部或外部命令

Pip comes with Python 3.8, but is located in the Python38/Scripts directory which isn't added to the PATH environment variable by default on Windows. Pip 随 Python 3.8 一起提供,但位于 Python38/Scripts 目录中,Windows 上默认情况下该目录未添加到 PATH 环境变量中。 What is installed in the PATH is the Python Launcher...a tool to manage multiple installations of Python.安装在 PATH 中的是 Python Launcher...一个用于管理 Python 的多个安装的工具。

Run py -0 to see installed Pythons, and py -m pip to run pip under the latest version of Python installed.运行py -0以查看已安装的 Python,并运行py -m pip pip 在安装的最新版本的 Python 下运行 pip。

If you do have multiple Python versions installed, py -3.8 -m pip will run pip under that specific version of Python.如果您安装了多个 Python 版本, py -3.8 -m pip将在该特定版本的 Python 下运行 pip。

Note that if you watch the installer, you do have the option to add the Python installation directory to the path, but if you plan to ever have multiple versions of Python installed it isn't recommended.请注意,如果您查看安装程序,您可以选择将 Python 安装目录添加到路径中,但如果您计划安装多个版本的 Python,则不建议这样做。

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

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