ARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140):

I have been trying to download pytorch and this is error message i get: Could not remove or rename C:\ProgramData\Anaconda3\pkgs\pytorch-1.5.1-py3.7_cuda102_cudnn7_0\Lib\site-packages\torch\lib\cudnn64_7.dll. Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140): Could not remove or rename C:\ProgramData\Anaconda3\pkgs\pytorch-1.5.1-py3.7_cuda102_cudnn7_0\Lib\site-packages\torch\lib\cudnn64_7.dll. Please remove this file manually (you may need to reboot to free file handles)

It seems conda is trying to remove the mentioned file, but isn’t able to do so.
Did you try to remove it manually (or reboot and remove it) as suggested in the error message?

1 Like

i have done that and i was able to install pytorch, however when i import pytorch i get the following error what do i do?
Traceback (most recent call last):
File “”, line 1, in
File “C:\ProgramData\Anaconda3\lib\site-packages\torch_init_.py”, line 103, in
raise err
OSError: [WinError 126] The specified module could not be found. Error loading “C:\ProgramData\Anaconda3\lib\site-packages\torch\lib\caffe2_nvrtc.dll” or one of its dependencies.

Couple of questions:

  1. Do you have the Nvidia GPU card plugged in? Have you installed the GPU driver for your Nvidia card?
  2. Have you installed VS 2019 Redist https://aka.ms/vs/16/release/vc_redist.x64.exe?
  3. There isn’t raise err in line 103 of __init__.py for v1.5.1 binaries. Are you sure you installed the correct version? See https://github.com/pytorch/pytorch/blob/v1.5.1/torch/__init__.py

No, please how do i go about achieving your questions: to install
1.Nvidia GPU card plugin
2.VS 2019 Redist

  1. Search, download and install the GPU driver at https://www.nvidia.com/download/index.aspx?lang=en-us
  2. Download and install https://aka.ms/vs/16/release/vc_redist.x64.exe

JUST write this command
conda update -n base conda-package-handling