首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python安装包:无法使用pip install命令安装包

Python安装包:无法使用pip install命令安装包
EN

Stack Overflow用户
提问于 2021-01-19 02:08:23
回答 3查看 757关注 0票数 0

我一直在尝试通过在anaconda提示符下使用pip install命令在我的conda环境中安装vertex包,但我一直收到以下警告和错误:

代码语言:javascript
复制
pip install vertex

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/vertex/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/vertex/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/vertex/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/vertex/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/vertex/
ERROR: Could not find a version that satisfies the requirement vertex
ERROR: No matching distribution found for vertex

anaconda提示符的屏幕截图:

我尝试延长pip命令的超时时间,得到以下警告和错误:

代码语言:javascript
复制
pip --default-timeout=1000 install vertex

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/vertex/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/vertex/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/vertex/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/vertex/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/vertex/
ERROR: Could not find a version that satisfies the requirement vertex
ERROR: No matching distribution found for vertex

anaconda提示符的屏幕截图:

大约一周前,我在安装scipy时遇到了同样的问题,但我使用以下命令设法绕过了它:

代码语言:javascript
复制
conda install -c conda-forge scipy

它成功了,然后我将conda-fronge通道添加到我的env中。尝试使用conda install命令安装vertex包时,我收到一条消息,它在当前通道中找不到vertex包,并且我没有设法找到合适的通道。命令行:

代码语言:javascript
复制
conda install vertex

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - vertex

Current channels:

  - https://conda.anaconda.org/bioconda/win-64
  - https://conda.anaconda.org/bioconda/noarch
  - https://conda.anaconda.org/anaconda/win-64
  - https://conda.anaconda.org/anaconda/noarch
  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/win-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

无论哪种方式,我都不能在我的conda环境中安装vertex包。

提前感谢所有帮助者:)

EN

回答 3

Stack Overflow用户

发布于 2021-01-19 02:16:30

这个包似乎在Anaconda Cloud上不可用,而且它的PyPI历史已经有几年了,没有更新。浏览一下项目的README,它看起来并不处于主动维护状态,因此您可能无法通过包管理器安装它(如果有的话)。

票数 1
EN

Stack Overflow用户

发布于 2021-01-19 02:27:46

你可以试着避免混合多个包源。这样做应该会减少依赖问题的概率。据我所知,在您的环境中,您现在有3个来源:

  • conda
  • conda-forge
  • pip

对于干净的conda环境,pip安装包时没有错误。

代码语言:javascript
复制
conda create -n vertex-env python=3
conda activate vertex-env
pip install vertex
pip list

使用上面的命令序列,我成功地安装了vertex包,尽管我没有验证运行时。

代码语言:javascript
复制
$ pip list
Package        Version
-------------- -------------------
attrs          20.3.0
Automat        20.2.0
certifi        2020.12.5
cffi           1.14.4
constantly     15.1.0
cryptography   3.3.1
hyperlink      21.0.0
idna           3.1
incremental    17.5.0
pip            20.3.3
pycparser      2.20
PyHamcrest     2.0.2
pyOpenSSL      20.0.1
setuptools     49.6.0.post20210108
six            1.15.0
Twisted        20.3.0
Vertex         0.3.1
wheel          0.36.2
zope.interface 5.2.0
票数 0
EN

Stack Overflow用户

发布于 2021-01-19 06:02:12

考虑到这个包有多老,几乎没有理由相信它可以在任何Python3版本上工作。事实上,searching for print commands in the repo code,我们发现一些缺少括号,这意味着Python3不兼容。因此,请尝试Python2.7构建,让Pip解决Python和Pip以外的所有问题:

vertex.yaml

代码语言:javascript
复制
name: vertex
channels:
  - conda-forge
  - defaults
  - free
dependencies:
  - python=2.7
  - pip
  - pip:
    - Vertex
    - service_identity

然后从shell (例如bash):

代码语言:javascript
复制
conda env create -n vertex -f vertex.yaml
conda activate vertex

这样就可以安装Vertex,并且在加载我在测试中找到的一些模块(例如from vertex import q2q)时不会抛出错误,但我并没有运行实际的测试。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65779865

复制
相关文章

相似问题

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