PyTorch not recognising CUDA device

I’ve removed all pytorch copies and tried to start again.

I installed pytorch with

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

Now pytorch-cuda is the only copy

In [12]: conda list pytorch

# packages in environment at C:\Users\<USER>\anaconda3:
# Name                     Version          Build            Channel
pytorch-cuda               11.8             h24eeafa_6       pytorch

However, I now get the following error

In [13]: torch.cuda.is_available()

AttributeError                            Traceback (most recent call last)
Cell In[13], line 1
----> 1 torch.cuda.is_available()

AttributeError: module ‘torch’ has no attribute ‘cuda’

Could you advise what I’m doing wrong?