Install from source fails on Windows 10/Conda

On Windows 10 and a fresh Python 3.8 environment on conda 4.8.3, I cloned the pyro repository and ran

python setup.py install

After running for a while it fails because it cannot install torch.

I realize this is similar to the other thread called “Install fails on windows”, but the solution there (different python in the path) does not apply to me. I am using the python installed in my fresh conda environment.

How can I fix this?

This is what I see at the tail of console messages:

(…)

Installing tqdm-script.py script to C:\Users\Me\AppData\Local\Continuum\anaconda3\envs\pyro\Scripts
Installing tqdm.exe script to C:\Users\Me\AppData\Local\Continuum\anaconda3\envs\pyro\Scripts

Installed c:\Users\Me\appdata\local\continuum\anaconda3\envs\pyro\lib\site-packages\tqdm-4.46.0-py3.8.egg
Searching for torch>=1.5.0
Reading https://pypi.org/simple/torch/
No local packages or working download links found for torch>=1.5.0
error: Could not find suitable distribution for Requirement.parse('torch>=1.5.0')

(pyro) C:\Users\Me\Documents\Research\pyro>conda install torch
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:

  - torch

I think you need to use the command conda install pytorch torchvision cpuonly -c pytorch. More information can be found here.

1 Like

Thanks. I simply missed the need to install PyTorch manually first.

I noticed that installation instructions in the Docs are to run python setup.py install but the ones on the home page say pip install .[extras]. Should the Docs be updated?

Thanks for pointing out! We should remove that entry from docs because it is duplicated with Getting-start section.

Hey there! I had a similar issue with installing packages on my Windows 10 machine with Conda. I found that sometimes, even though I had the correct Python version installed in my Conda environment, I needed to manually install the package separately using pip. In your case, it seems like you need to install PyTorch manually before running the setup.py script.
As for your question about the installation instructions in the Docs, it might be worth checking if there have been any updates or changes to the installation process since the last time the documentation was updated. It’s always good to double-check and make sure you’re following the most up-to-date instructions. However, you can check some other suggestions on the Reddit windows keys sub.