Unable to get cuda available in Jupyter Notebook or Spyder for PyTorch
I've installed pytorch cuda with pip and conda

when i run this command in IDLE:

&gt;&gt; import torch

&gt;&gt; torch.cuda.is_available()


I get "True",
but in Spyder or Jupyter Notebook it gives as "False" even after updating the package and conda.
The conda update of pytorch cuda was from 10.1 to 10.2

It can be resolved by creating another environment in conda and then install torch

type:

&gt;conda create -n yourenvname python=x.x anaconda


yourenvname is environment name

python=x.x is python version for your environment

activate the environment using:

&gt;conda activate yourenvname


then install the PyTorch with cuda:

&gt;conda install pytorch torchvision cudatoolkit=10.2 -c pytorch


open "spyder" or "jupyter notebook"
verify if it is installed, type:

&gt; import torch
&gt; torch.cuda.is_available()

