pythonpippytorchcondapytorch3d

Cannot install pytorch3d using conda or pip on windows 11


I'm trying to install pytorch3d, but neither conda or pip can find the pytorch3d package.

I followed the pytorch instructions: https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md

The runtime dependencies can be installed by running:

conda create -n pytorch3d python=3.9
conda activate pytorch3d
conda install pytorch=1.13.0 torchvision pytorch-cuda=11.8 -c pytorch -c nvidia
conda install -c fvcore -c iopath -c conda-forge fvcore iopath

For the CUB build time dependency, which you only need if you have CUDA older than 11.7 (I have CUDA 12), if you are using conda, you can continue with

conda install -c bottler nvidiacub

Anaconda Cloud

conda install pytorch3d -c pytorch3d

I get the error:

PackagesNotFoundError: The following packages are not available from current channels:

  - pytorch3d

When I run:

pip install pytorch3d

I get this error:

ERROR: Could not find a version that satisfies the requirement pytorch3d (from versions: none)
ERROR: No matching distribution found for pytorch3d

Solution

  • You have missed something in the docs that you followed. Note that under Installing prebuilt binaries for PyTorch3D there is Install with CUDA support from Anaconda Cloud, on Linux only, so installing using conda is only supported on linux. You can also see this if you search on anaconda.org and check the page https://anaconda.org/pytorch3d/pytorch3d:

    enter image description here

    Note how it only has a linux-x64 tag

    For pip, we can check the available files on PyPi here:

    enter image description here

    Note that there are only macOS files.

    To summarize: Neither of your installation methods are supported on windows. You will need to install from source.

    The main command to do so is

    pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"