torch.cuda.is_available() True in (base), but False in other conda env
I run this code in Anaconda prompt, and it returns True.
(base) C:\User
torch.cuda.is_available()
True

But when I run other conda environment, it just doesn't work.
(pytorch_project) C:\User
torch.cuda.is_available()
False

The problem seems to be different results of torch.version.cuda.
(base) torch.version.cuda = 10.1
(pytorch_project) torch.version.cuda = 10.2
But I don't know why they are different...
How do I make 10.2 down to 10.1 and make is_available() == True ?

Here is my info.
 Windows 10 / nvidia-smi=425.31 / CUDA ver=10.1 / pytorch=1.4.0 / torchvision=0.5.0

conda list

Thank you for your answers and comments. &lt;3
I've solved the problem.
I use Visual Studio Code as the developer environment tool, but as shown in the picture I uploaded, conda list pointed at exact the same directory, which means I didn't actually activate my environment.
It should be like (pytorch) C:\User , but it's (Power Shell) PS C:\User instead.
To solve this, I went to Settings → Terminal &gt; Integrated &gt; Shell Args: Windows and edited settings.json with
&quot;terminal.integrated.shellArgs.windows&quot;: [&quot;-ExecutionPolicy&quot;, &quot;ByPass&quot;, &quot;-NoExit&quot;,&quot;-Command&quot;,&quot;&amp; 'C:\\Users\\user\\miniconda3\\shell\\condabin\\conda-hook.ps1'&quot; ]

Reference: https://blog.lcarbon.idv.tw/vscode-設定-anaconda-路徑至-visual-studio-code-終端機中windows/
By starting a new terminal I got (pytorch) PS C:\User correctly, and saw my torch=1.5.0 using conda list.
Then I run conda install pytorch torchvision cudatoolkit=10.1 -c pytorch to change the pytorch version.
And Voilà!!
torch.cuda.is_available()
True

