From torch._C import * : No Torch._C!

username: skaminsky
cooked: <p>When I call, “import torch,”  I get:<br>
“ImportError: DLL load failed while importing <em>C: The specified module could not be found," caused in the file:<br>
"torch_<em>init</em></em>.py”<br>
by the line:<br>
"from torch._C import * "<br>
In my file structure, there is no “Torch._C.” Nor is there a folder “csrc.”<br>
I use Windows 10, 64 bit. I installed PyTorch with:<br>
“pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f <a href="https://download.pytorch.org/whl/torch_stable.html" rel="nofollow noopener">https://download.pytorch.org/whl/torch_stable.html</a>”<br>
(Stable1.4, Windows, Python, Cuda=none).<br>
I have the same failure when installing on Python 3.6.1 and on Python 3.8,1.<br>
I have fought this problem for a week, now. I have seen this problem addressed in many places on the internet. Help would be appreciated. Is there something missing from my computer, some ‘C’ capability, that I need to install?</p>

username: ptrblck
cooked: <p>You would get this error e.g. if your current working directory is inside the pytorch folder (after building from source), so make sure to open the Python terminal somewhere else.</p>
<p>Also, this might happen, if the installation was unsuccessful or if you have multiple pytorch installations in your current environment (although the error might look different).</p>
<p>How did you install PyTorch and could you create a new environment and reinstall it?</p>

username: skaminsky
cooked: <p>I installed PyTorch by opening a Windows command prompt. In it, I pasted, "pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f <a href="https://download.pytorch.org/whl/torch_stable.html%E2%80%9D" rel="nofollow noopener">https://download.pytorch.org/whl/torch_stable.html”</a> , (as I said in my original post). The Windows PATH commands would then cause pip to run in the Python/Python38/Scripts folder. It successfully(?) installed PyTorch and TorchVision in Python/Python38/Lib/sitepackages, in the same folder as the sci-py, numpy, sklearn packages.<br>
I had this problem when I only had Python 3.6.1 installed. I reinstalled PyTorch many times. I then installed Python 3.8, to see if PyTorch would work with that, and I have the same problem. I start Python from the Windows IDLE program which is installed with Python. But even if I start Python from a Windows command prompt and type “import torch,” I get the same failure.<br>
I’m not sure what you mean when you say, “create a new environment,” or “your current working directory is inside the pytorch folder.” But, my Python file structure looks good to me.It got me through 20 data science courses from DataCamp, and books like “Deep Learning from Scratch.”</p>

username: ptrblck
cooked: <p>Could you post the output log of the <code>pip install ...</code> command?</p>

username: peterjc123
cooked: <p>Which Python distribution did you use? Anaconda or just Python from the official site? If the latter one is used, please install VS 2017 Redist on your own. <a href="https://aka.ms/vs/16/release/vc_redist.x64.exe" rel="nofollow noopener">https://aka.ms/vs/16/release/vc_redist.x64.exe</a> Also please install some other dependencies through <code>pip install intel-openmp mkl</code> and then restart the command prompt.</p>

username: skaminsky
cooked: <p>Your solution worked! Thank you so very much.</p>