Installed Pytorch 1.12.1 in the conda environment but it detects version 1.10.0+cpu

Recently, I have installed pytorch 1.12.1 in the conda environment. After installation, I checked the version of pytorch using print(torch.__version__), it returns 1.10.0+cpu. I also checked the available packages in the environment. It shows pytorch version 1.12.1

I am unable to understand why it is detecting version 1.10.0+cpu. I even reinstalled Anaconda python in Windows, still it shows same version 1.10.0+cpu even in the base environment.

My system has Nvidia 1650Ti GPU and Cuda 11.7 with Nvidia driver 517.00 is installed.

Is Pytorch 1.10.0+cpu inbuilt in anaconda python?

No packages should be built into the anaconda base env unless you specify them during its setup. Delete the torch installation from the base env, install the desired version in your new virtual env and it should work. If that’s still not the case check all install logs and make sure no other of your installed packages needs the older 1.10 release and installs it additionally.

Thanks for the reply. I have not installed Pytorch in ‘base’ environment. I created new environment and then installed it.

I even uninstalled Anaconda python completely and reinstalled it.
After reinstalling Anaconda python, I executed commands import torch, and print(torch.__version__).
It is very strange that even without installing Pytorch, it is able to import it and it shows version 1.10.0+cpu.

Also, ‘conda list’ does not show Pytorch package in the list (Refer figure)
image

In that case your conda env might detect a pip installed PyTorch binary. Uninstall all PyTorch versions from conda, pip, and any other way you’ve previously installed it to create a clean environment first, then install it it the desired env only.

1 Like

Thanks for your input. I tried uninstalling the existing pytorch version 1.10.0+cpu using pip/conda but nothing was working. I was finally able to get rid of it by deleting the old Python folder at ‘C:\Users\Vikrant\AppData\Roaming\Python’. I created a new environment and installed Pytorch 1.12.1. Now, everything is working fine. Thanks!