Import error on Windows10 with pytorch0.4
Discription

I am trying to install pytorch 0.4 on Windows10. 
My enviroment settings:
- Windows10
- cuda9.0
- python 3.6
- pytorch 0.4
- anaconda

I tried by using both conda install -n myenv and pip install $path:whl and both failed.

Error

&gt;&gt;&gt; import torch
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "D:\Anaconda\envs\py3.6_pytorch0.4\lib\site-packages\torch\__init__.py", line 80, in &lt;module&gt;
    from torch._C import *
ImportError: DLL load failed:


I found the related a issue #4518 under pytorch but answers under that issue do not work for me.

What I have tried


add all conda related path to environment path
change the directory (cd)
install vs_runtime under this conda env


None of those works.

But if I install pytorch under conda's base environment, it works well.

So what's going on here?



Update:

When we tried to install pytorch on windows, a lot of packages need to be installed at the same time. We can simply follow the steps on official website [link](https://pytorch.org/），for python 3.6 and cuda9.0 the installation command is as 

    conda install pytorch torchvision cudatoolkit=9.0 -c pytorch


If we want to install former version of pytorch, we can assign the version, eg. 0.4 as 

    conda install pytorch=0.4 torchvision cudatoolkit=9.0 -c pytorch


After you create the new environment with conda, execute conda install -c pytorch pytorch to install pytorch. 

pip does not work that well with external, non-Python dependencies. Not unlikely in your case path to the DLL is not set correctly (just a guess).
