![使用 Nexus 安裝 conda 通道包](https://rvso.com/image/1598534/%E4%BD%BF%E7%94%A8%20Nexus%20%E5%AE%89%E8%A3%9D%20conda%20%E9%80%9A%E9%81%93%E5%8C%85.png)
我在透過 Sonatype Nexus Repository Manager(版本:PRO 3.16.1-02)安裝 conda 通道套件時遇到問題。例如下面的程式碼
conda install pytorch::pytorch==1.1.0
#is equivalent to:
#conda install --channel pytorch pytorch==1.1.0
在控制台上列印以下錯誤訊息:
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/linux-64/current_repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /pytorch/linux-64/current_repodata.json (Caused by ConnectTimeoutError
(<urllib3.connection.VerifiedHTTPSConnection object at 0x7feb2d7f3c50>, 'Connection to conda.anaconda.org timed out. (connect timeout=9.15)'))",),)
我相信問題是當我指定 conda 使用的 conda 通道時https://conda.anaconda.org/pytorch/linux-64/current_repodata.json而不是 Nexus URL(這不起作用,因為我在代理後面,Nexus 應該為我下載)。我的問題是如何讓 conda 使用 Nexus URL 或以某種方式確保 Nexus 可以從 conda 通道下載 python 套件?
親切的問候
麥可