python – Cannot install OpenCV in the same conda environment as PyTorch

I have a conda enviornment named ‘pytorch-train’ where I have PyTorch with all CUDA related packages. When I try to install OpenCV in this environment it takes forever to solve the environment and it never reaches the end of the solving process.

The command for installing pytorch in my case is:

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

The command for installing opencv is

conda install -c conda-forge opencv

I’ve try reinstalling every tool and the result is that they can be installed independently but not in the same environment.

Read more here: Source link