【问题标题】:setuptools: installing pytorch from download link: 403 Forbiddensetuptools:从下载链接安装 pytorch:403 Forbidden
【发布时间】:2018-02-12 09:51:38
【问题描述】:

我正在尝试将 pytorch 包含在 setuptools 的要求列表中:

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之后我收到了:

error: Can't download http://download.pytorch.org/whl/cpu/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl@develop#egg=torch: 403 Forbidden

我也尝试使用源安装链接而不是 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 的正确方法是什么? (注意:在我的情况下,使用 anaconda 不是一个选项)

谢谢。

编辑

按照答案中的建议,我也尝试过:

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).

【问题讨论】:

    标签: python pip setuptools pypi pytorch


    【解决方案1】:

    第一个错误:如果您使用直接 URL 指向轮文件:

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

    您不得使用@develop#egg=torch。该部分用于从 git 之类的 VCS 安装。

    第二个网址

    https://github.com/pytorch/pytorch#from-source
    

    也是错误的。应该是

    https://github.com/pytorch/pytorch
    

    如果你想安装develop 分支,这里@develop#egg=torch 是完全正确的。

    【讨论】:

    • 感谢您的回答。两个版本都给我同样的错误。是不是不能用setuptools安装torch?
    猜你喜欢
    • 2012-02-22
    • 2012-02-17
    • 1970-01-01
    • 1970-01-01
    • 2021-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多