Installation failing in Anaconda environment

I would really appreciate some help in getting PyTorch working in Anaconda.

I created a new Anaconda environment and then ran:
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

and got the following messages:

The following specifications were found to be incompatible with each other:

Output in format: Requested package → Available versions

Package setuptools conflicts for:
python=3.12 → pip → setuptools
pytorch → jinja2 → setuptools
torchvision → setuptools

Package requests conflicts for:
python=3.12 → pip → requests
torchvision → requests

Package typing conflicts for:
pytorch → typing_extensions → typing[version=‘>=3.6.2|>=3.7.4’]
torchvision → typing_extensions → typing[version=‘>=3.6.2|>=3.7.4’]

Package pytorch-cuda conflicts for:
torchaudio → pytorch-cuda[version='11.6.|11.7.|11.8.|12.1.']
torchaudio → pytorch==2.1.0 → pytorch-cuda[version=‘>=11.6,<11.7|>=11.7,<11.8|>=11.8,<11.9|>=12.1,<12.2’]
pytorch → pytorch-cuda[version=‘>=11.6,<11.7|>=11.7,<11.8|>=11.8,<11.9|>=12.1,<12.2’]
torchvision → pytorch==2.1.0 → pytorch-cuda[version=‘>=11.6,<11.7|>=11.7,<11.8|>=11.8,<11.9|>=12.1,<12.2’]
torchvision → pytorch-cuda[version='11.6.|11.7.|11.8.|12.1.']

Package pytorch conflicts for:
torchaudio → pytorch[version=‘1.10.0|1.10.1|1.10.2|1.11.0|1.12.0|1.12.1|1.13.0|1.13.1|2.0.0|2.0.1|2.1.0|1.9.1|1.9.0|1.8.1|1.8.0|1.7.1|1.7.0|1.6.0’]
torchvision → pytorch[version=‘1.10.0|1.10.1|1.10.2|1.11.0|1.12.0|1.12.1|1.13.0|1.13.1|2.0.0|2.0.1|2.1.0|1.9.1|1.9.0|1.8.1|1.8.0|1.7.1|1.7.0|1.6.0|1.5.1’]The following specifications were found to be incompatible with your system:

    • pytorch → sympy → __unix*

Your installed version is: not available

Note that strict channel priority may have removed packages required for satisfiability.

I also tried:
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
conda install pytorch torchvision torchaudio pytorch-cuda=11.2 -c pytorch -c nvidia
(the same CUDA as the root of my PC)
conda install pytorch pytorch-cuda=12.1 -c pytorch -c nvidia
pip3 install torch torchvision torchaudio --index-url

They all fail…

I’m running Windows 11, with a RTX3060mobile

Objective: train classification models with BERT on my PC

Any suggestions on how to precced?



Your Python version might be too new so downgrade to 3.11 or 3.10.