setuptools:从下载链接安装pytorch:403禁止

2024-04-27 04:29:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在setuptools的需求列表中包括pytorch:

install_requires=[
      'torch'
      ],
dependency_links=[
      'http://download.pytorch.org/whl/cpu/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl' '@develop#egg=torch'
      ],

但运行python setup.py develop后,我收到:

^{pr2}$

我还尝试使用source install链接,而不是pip的链接:

install_requires=[
      'torch'
      ],
  dependency_links=[
      'https://github.com/pytorch/pytorch#from-source' '@develop#egg=torch'
      ],

但随后:

RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

通过setuptools安装pytorch的正确方法是什么?(注:在我的情况下,使用Python不是一个选择)

谢谢。在

编辑

正如答案中建议的那样,我也尝试了:

dependency_links=[
      'https://github.com/pytorch/pytorch'
      ],


dependency_links=[
      'https://github.com/pytorch/pytorch#egg=torch'
      ],


dependency_links=[
      'http://download.pytorch.org/whl/cpu/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl'
      ],

并收到:

RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

Tags: installhttpsgithubcomhttpeggdownloadtorch
1条回答
网友
1楼 · 发布于 2024-04-27 04:29:05

第一个错误:如果使用指向控制盘文件的直接URL:

http://download.pytorch.org/whl/cpu/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl

不能使用@develop#egg=torch。这部分是用来安装从风投,如git。在

第二个URL

^{pr2}$

也是错误的。应该是的

https://github.com/pytorch/pytorch

如果您想安装develop分支,@develop#egg=torch就完全正确了。在

相关问题 更多 >