简体   繁体   English

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

[英]Python install packages: Couldn't install packages with pip install command

I've been trying to install the vertex package on my conda environment by using the pip install command on the anaconda prompt, but I keep getting the following warnings and errors:我一直在尝试通过在 anaconda 提示符上使用 pip install 命令在我的 conda 环境中安装顶点 package,但我不断收到以下警告和错误:

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

Screenshot from the anaconda prompt: anaconda 提示的屏幕截图: anaconda 提示中的错误

I tried to extend the timeout of the pip command and got the following warnings and errors:我试图延长 pip 命令的超时时间,得到以下警告和错误:

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

Screenshot from the anaconda prompt: anaconda 提示的屏幕截图: anaconda 提示中的错误

I've had the same problem installing scipy about a week ago but I managed to bypass it by using the following command:大约一周前,我在安装 scipy 时遇到了同样的问题,但我设法通过使用以下命令绕过它:

conda install -c conda-forge scipy

It succeeded and then I added the conda-fronge channel to my env.它成功了,然后我将 conda-fronge 频道添加到我的环境中。 Trying to install the vertex package using the conda install command I got a message that it couldn't find the vertex package in the current channels and I didn't manage to find the appropriate channel for this.尝试使用 conda install 命令安装顶点 package 我收到一条消息,它无法在当前通道中找到顶点 package 并且我没有设法为此找到合适的通道。 The command line:命令行:

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.

Either ways I couldn't install the vertex package in my conda environment.无论哪种方式,我都无法在我的 conda 环境中安装顶点 package。

Thanks in advance to all helpers:)在此先感谢所有帮助者:)

This package does not seem to be available on Anaconda Cloud and its PyPI history is several years old with no updates.这个 package 似乎在 Anaconda Cloud 上不可用,它的PyPI历史已有几年历史,没有更新。 Skimming the project's README , it does not look to be in an actively-maintained state, so you're probably not going to be able to install it via a package manager (if at all).浏览项目的自述文件,它看起来并不在积极维护的 state 中,因此您可能无法通过 package 管理器安装它(如果有的话)。

You can try avoiding mixing multiple packages sources.您可以尝试避免混合多个包源。 Doing that should decrease probability of dependency problems.这样做应该会降低依赖性问题的可能性。 To my understanding in your environment you now have 3 sources:据我了解,您现在有 3 个来源:

  • conda康达
  • conda-forge康达锻造
  • pip pip

For a clean conda environment pip installs the package without errors.对于干净的 conda 环境,pip 安装 package 没有错误。

conda create -n vertex-env python=3
conda activate vertex-env
pip install vertex
pip list

Using command sequence above I managed to successfully install the vertex package, although I did not verify the run-time.使用上面的命令序列,我成功地安装了顶点 package,尽管我没有验证运行时。

$ 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

Given how old this package is, there is little reason to believe it will work with any Python 3 versions.考虑到这个 package 有多老,几乎没有理由相信它可以与任何 Python 3 版本一起使用。 In fact, searching for print commands in the repo code , we find some lacking parentheses, which implies Python 3 incompatibility.事实上,在repo代码中搜索print命令,我们发现一些缺少括号,这意味着Python 3不兼容。 Hence, instead try a Python 2.7 build and just let Pip resolve everything other than the Python and Pip:因此,请尝试使用 Python 2.7 构建,然后让 Pip 解决除 Python20BFD1743A0743CE2E9A5AA20B672Z 以外的所有问题

vertex.yaml顶点.yaml

name: vertex
channels:
  - conda-forge
  - defaults
  - free
dependencies:
  - python=2.7
  - pip
  - pip:
    - Vertex
    - service_identity

Then from shell (eg, bash):然后从 shell (例如,bash):

conda env create -n vertex -f vertex.yaml
conda activate vertex

This gets it so Vertex installs and doesn't throw errors when loading some of the modules I found in the tests (eg, from vertex import q2q ), but I didn't run the actual tests.这样就可以安装 Vertex 并且在加载我在测试中找到的一些模块时不会抛出错误(例如, from vertex import q2q ),但我没有运行实际测试。

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

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