Pytorch is installed, but while importing getting error
I have installed Anaconda on windows 8, after that done with the PyTorch. 
But while importing torch getting error. 


  import torch


  AttributeError                            Traceback (most recent 
call last)

&lt;ipython-input-4-eb42ca6e4af3&gt; in &lt;module&gt;

----&gt; 1 import torch


I:\ProgramData\Anaconda3\lib\site-packages\torch\__init__.py in 
&lt;module&gt;
 51         from ctypes.wintypes import DWORD, HMODULE
 52 

---&gt; 53         AddDllDirectory = windll.kernel32.AddDllDirectory
 54         AddDllDirectory.restype = DWORD
 55         AddDllDirectory.argtypes = [c_wchar_p]


I:\ProgramData\Anaconda3\lib\ctypes\__init__.py in __getattr__(self, 
name)
367         if name.startswith('__') and name.endswith('__'):
368             raise AttributeError(name)

--&gt; 369         func = self.__getitem__(name)
370         setattr(self, name, func)
371         return func


I:\ProgramData\Anaconda3\lib\ctypes\__init__.py in __getitem__(self, 
name_or_ordinal)
372 
373     def __getitem__(self, name_or_ordinal):

--&gt; 374         func = self._FuncPtr((name_or_ordinal, self))
375         if not isinstance(name_or_ordinal, int):
376             func.__name__ = name_or_ordinal


AttributeError: function 'AddDllDirectory' not found


Also when I used the following command it is showing the pytorch in 
Anaconda command prompt. 

(base) C:\Users\rk88&gt;conda list pytorch

# packages in environment at I:\ProgramData\Anaconda3:

#

# Name                    Version                   Build  Channel

pytorch                   1.0.1           py3.7_cuda100_cudnn7_1    
PyTorch


Anyone can please help me how to resolve this, if you faced this issue earlier. 

Thanks,

Try out the below  in your anaconda prompt

conda create -n &lt;env_name&gt;python=3.6

conda activate &lt;env_name&gt;

conda install pytorch-cpu torchvision-cpu -c pytorch 


If you are  using a GPU 

 conda install pytorch torchvision cudatoolkit=9.0 -c pytorch


Please refer https://pytorch.org/
