This is my first time using anaconda and jupyter notebook. I installed anaconda3, started a new environment, installed pytorch 1.4.0, and then ran jupyter notebook
. But when I tried running import torch
in the notebook, I got this error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import torch
File ~\.conda\envs\gan\lib\site-packages\torch\__init__.py:81
77 sys.setdlopenflags(_dl_flags.RTLD_GLOBAL | _dl_flags.RTLD_LAZY)
79 del _dl_flags
---> 81 from torch._C import *
83 __all__ += [name for name in dir(_C)
84 if name[0] != '_' and
85 not name.endswith('Base')]
87 if platform.system() != 'Windows':
ImportError: DLL load failed while importing _C: The specified module could not be found.
I've tried restarting the kernel, but it didn't work. I also tried downloading and extracting DLL files as mentioned in this post: https://stackoverflow.com/a/51142648/15389253
I ran pip install torch
on the command prompt on my computer, and then when I ran python
in cmd, I could install and use pytorch without an error. Why does it not work in jupyter notebook?
Update: I ran conda install -c pytorch pytorch=1.4.0
in the gan environment but it said "All requested packages already installed."