簡體   English   中英

Python 安裝包:無法使用 pip 安裝命令安裝包

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

我一直在嘗試通過在 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

anaconda 提示的屏幕截圖: anaconda 提示中的錯誤

我試圖延長 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

anaconda 提示的屏幕截圖: anaconda 提示中的錯誤

大約一周前,我在安裝 scipy 時遇到了同樣的問題,但我設法通過使用以下命令繞過它:

conda install -c conda-forge scipy

它成功了,然后我將 conda-fronge 頻道添加到我的環境中。 嘗試使用 conda install 命令安裝頂點 package 我收到一條消息,它無法在當前通道中找到頂點 package 並且我沒有設法為此找到合適的通道。 命令行:

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 環境中安裝頂點 package。

在此先感謝所有幫助者:)

這個 package 似乎在 Anaconda Cloud 上不可用,它的PyPI歷史已有幾年歷史,沒有更新。 瀏覽項目的自述文件,它看起來並不在積極維護的 state 中,因此您可能無法通過 package 管理器安裝它(如果有的話)。

您可以嘗試避免混合多個包源。 這樣做應該會降低依賴性問題的可能性。 據我了解,您現在有 3 個來源:

  • 康達
  • 康達鍛造
  • pip

對於干凈的 conda 環境,pip 安裝 package 沒有錯誤。

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

使用上面的命令序列,我成功地安裝了頂點 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

考慮到這個 package 有多老,幾乎沒有理由相信它可以與任何 Python 3 版本一起使用。 事實上,在repo代碼中搜索print命令,我們發現一些缺少括號,這意味着Python 3不兼容。 因此,請嘗試使用 Python 2.7 構建,然后讓 Pip 解決除 Python20BFD1743A0743CE2E9A5AA20B672Z 以外的所有問題

頂點.yaml

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

然后從 shell (例如,bash):

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

這樣就可以安裝 Vertex 並且在加載我在測試中找到的一些模塊時不會拋出錯誤(例如, from vertex import q2q ),但我沒有運行實際測試。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM