Pip install fastai causes uninstall of pytorch and pytorch non-cuda install

Installation steps on a brand new PC:

  1. install python / pip
  2. install VS community edition
  3. install latest cuda software (https://developer.download.nvidia.com/compute/cuda/12.4.1/local_installers/cuda_12.4.1_551.78_windows.exe)
  4. install pytorch (pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121)
  5. pip install fastbook

everything functions normally

fastbook needs an older version of pytorch, so it uninstalls pytorch, and re-installs the NON-CUDA version

Can you somehow detect if the wrong version of pytorch is installed to see whether it’s CUDA or not, rather than installing the CPU only version?