This could mean that a CPU-only package is already installed. Create a new virtual environment and reinstall PyTorch there (and check the install logs for cudatoolkit or the corresponding CUDA tag in the wheel name) or alternatively uninstall all PyTorch packages in your current environment and reinstall it again.