0

I'm trying to install pytorch that supports cuda 11.4. I found the following command worked for me:

pip install torch==1.12.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113

However, I still want to convert the above command into setup.py and my current setup.py looks like the following:

# setup.py
from setuptools import setup
from setuptools import find_packages

setup(
    name='python',
    version='0.1.0',
    python_requires='>=3.8.0',
    packages=find_packages(),
    install_requires=[
                      'torch==1.12.1+cu113',
                      ...]
)

Right now I got ERROR: No matching distribution found for torch==1.12.1+cu113. And I know dependency_links is already deprecated. Then how do I include --extra-index-url https://download.pytorch.org/whl/cu113 in my setup.py? Alternatively, since I'm using pip install ., how may I include --extra-index-url https://download.pytorch.org/whl/cu113 in this command?

The following didn't work:

pip install . --find-links=https://download.pytorch.org/whl/cu113  
pip install . --index-url https://download.pytorch.org/whl/cu113
pip install . --extra-index-url=https://download.pytorch.org/whl/cu113 
noobie2023
  • 721
  • 8
  • 25
  • I'm closing this post as it has been posted here: https://stackoverflow.com/questions/71252030/how-to-setup-py-my-package-that-depends-on-pytorch and here: https://stackoverflow.com/questions/66738473/installing-pytorch-with-cuda-in-setup-py – noobie2023 Feb 18 '23 at 00:18

0 Answers0