什么是“python3 -m pip install --upgrade”?

什么是“python3 -m pip install --upgrade”?

我已经github使用命令安装了该软件包python3 -m pip install --upgrade github.py,但现在无法卸载它,pip3 uninstall github因为它显示未安装。如果我没有安装该软件包,我该怎么办?

❯ python3 -m pip install --upgrade github.py
Collecting github.py
  Downloading github.py-0.5.0-py3-none-any.whl (80 kB)
     |████████████████████████████████| 80 kB 2.5 MB/s
Collecting aiohttp
  Downloading aiohttp-3.7.3-cp38-cp38-manylinux2014_x86_64.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 8.0 MB/s
Collecting typing-extensions>=3.6.5
  Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting async-timeout<4.0,>=3.0
  Downloading async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Collecting yarl<2.0,>=1.0
  Downloading yarl-1.6.3-cp38-cp38-manylinux2014_x86_64.whl (324 kB)
     |████████████████████████████████| 324 kB 7.8 MB/s
Requirement already satisfied, skipping upgrade: chardet<4.0,>=2.0 in /usr/lib/python3/dist-packages (from aiohttp->github.py) (3.0.4)
Requirement already satisfied, skipping upgrade: attrs>=17.3.0 in /usr/lib/python3/dist-packages (from aiohttp->github.py) (19.3.0)
Collecting multidict<7.0,>=4.5
  Downloading multidict-5.1.0-cp38-cp38-manylinux2014_x86_64.whl (159 kB)
     |████████████████████████████████| 159 kB 19.2 MB/s
Requirement already satisfied, skipping upgrade: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp->github.py) (2.8)
Installing collected packages: typing-extensions, async-timeout, multidict, yarl, aiohttp, github.py
Successfully installed aiohttp-3.7.3 async-timeout-3.0.1 github.py-0.5.0 multidict-5.1.0 typing-extensions-3.7.4.3 yarl-1.6.3

答案1

什么是“python3 -m pip install --upgrade”?

pip 此命令使用与命令(Python 安装)关联的版本python3来将包安装/升级到特定的 Python 安装。

如果我没有安装该软件包,我该怎么办?

您显然安装了以下软件包:

Installing collected packages: typing-extensions, async-timeout, multidict, yarl, aiohttp, github.py

Successfully installed aiohttp-3.7.3 async-timeout-3.0.1 github.py-0.5.0 multidict-5.1.0 typing-extensions-3.7.4.3 yarl-1.6.3

python3 -m pip猜测一下,您的( python3) 命令和您的命令可能pip3与您系统上的单独 Python 安装相关联。Python 允许这样做以进行隔离(因此您可以拥有一个包含一组包的 Python 环境,并独立于另一个 Python 环境管理这些包)。如果是这种情况,则python3 -m pip安装github.py到 Python 安装中,该安装不是与您的pip3命令相关联。

您应该能够github.py使用类似 的命令来卸载python3 -m pip uninstall github.py。如果您想查看 Python 安装python3pip3参考,请分别尝试运行which python3which pip3

相关内容