首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >升级windows上的pip以递归方式下载所有依赖项

升级windows上的pip以递归方式下载所有依赖项
EN

Stack Overflow用户
提问于 2020-12-30 15:42:46
回答 1查看 120关注 0票数 0

我使用devpi作为我的专用pypi服务器。当我在一个提升的命令提示符中升级pip时,我注意到了一种以前从未见过的递归行为,简单地说,pip正在下载所有的pip到pip 1。

代码语言:javascript
复制
python -m pip install --upgrade pip
Looking in indexes: http://localhost:3141/packages/staging/
Requirement already satisfied: pip in c:\python39\lib\site-packages (20.3.2)
Collecting pip
  Downloading http://localhost:3141/root/pypi/%2Bf/fab/098c8a1758295/pip-20.3.3-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB ...
  Downloading http://localhost:3141/root/pypi/%2Bf/79c/1ac8a9dccbec8/pip-20.3.3.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading http://localhost:3141/root/pypi/%2Bf/8d7/79b6a85770bc5/pip-20.3.2-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB ...
  Downloading http://localhost:3141/root/pypi/%2Bf/aa1/516c1c8f6f634/pip-20.3.2.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading http://localhost:3141/root/pypi/%2Bf/425/e79b20939abbf/pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
  Downloading http://localhost:3141/root/pypi/%2Bf/43f/7d3811f05db95/pip-20.3.1.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading http://localhost:3141/root/pypi/%2Bf/323/6fe7288d155c2/pip-20.3-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB ...
  Downloading http://localhost:3141/root/pypi/%2Bf/9ae/7ca6656eac22d/pip-20.3.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB ...
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
  Downloading http://localhost:3141/root/pypi/%2Bf/51f/1c7514530bd5c/pip-20.2.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.8 MB/s
  Downloading http://localhost:3141/root/pypi/%2Bf/85c/99a857ea0fb0a/pip-20.2.4.tar.gz (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
  Installing build dependencies ... canceled
ERROR: Operation cancelled by user

当我在非提升提示符pip中运行相同的命令时,它应该工作。

代码语言:javascript
复制
python -m pip install pip
Looking in indexes: http://localhost:3141/packages/staging/
Requirement already satisfied: pip in c:\python39\lib\site-packages (20.3.2)

同样,递归地下载所有依赖项也有点奇怪。我认为,如果我有一个较旧的pip,则非高架提示符会抛出一个错误,因为pip没有安装在用户主目录中。

代码语言:javascript
复制
python -m pip list --path "c:\python39\lib\site-packages"
Package    Version
---------- -------
pip        20.3.2
setuptools 50.3.2
vboxapi    1.0

通过排除devpi,它肯定是pip,同样的行为。

代码语言:javascript
复制
python -m pip install --index-url https://pypi.org/simple --upgrade --no-cache-dir pip

Ok报告的这里

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-30 17:53:22

实际上,它是由错误上的-U/--upgrade标志触发的。为了解决这个问题,我安装了pip20.3.3,提供了一个确切的版本。

代码语言:javascript
复制
python -m pip install 'pip==20.3.3'
Looking in indexes: http://localhost:3141/packages/staging/
Collecting pip==20.3.3
  Downloading http://localhost:3141/root/pypi/%2Bf/fab/098c8a1758295/pip-20.3.3-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.3.2
    Uninstalling pip-20.3.2:
      Successfully uninstalled pip-20.3.2
Successfully installed pip-20.3.3

现在看来已经解决了

代码语言:javascript
复制
python -m pip install --upgrade pip
Looking in indexes: http://localhost:3141/packages/staging/
Requirement already satisfied: pip in c:\python39\lib\site-packages (20.3.3)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65509583

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档