Reputation: 1216
I installed Pytorch for PYthon 3.6 using pip as instructed on https://pytorch.org/.
Pytorch is installed succesfully, but when I run code, I get this:
File "C:\Users\\PycharmProjects\chatbot-light\pytorch\rnn_attention\seq2seq_translation_tutorial.py", line 93, in <module>
import torch
File "C:\Users\\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\__init__.py", line 78, in <module>
from torch._C import *
ImportError: DLL load failed: The specified module could not be found
Upvotes: 2
Views: 2834
Reputation: 149
win-64/intel-openmp-2018.0.3-0.tar.bz2
Library/bin/
to any directoryThis solved ImportError on my computer with Windows 10 + Python 3.6.6 + PyTorch 0.4.0.
Hope it helps.
Upvotes: 1
Reputation: 531
This is an open Windows-related issue, see https://github.com/pytorch/pytorch/issues/4518 .
As a work-around, I installed SUSE Linux in a VirtualBox on Win10, then used the Linux pip instructions on PyTorch.org. No import error. BTW, the MS Visual Studio Code editor can be installed in Linux if you go that route.
Upvotes: 0
Reputation: 38500
I remember getting an import error (I think it was the same error you show) when I installed Pytorch with CUDA.
Installing Pytorch without CUDA made the error go away.
conda install pytorch-cpu -c pytorch
pip3 install torchvision
The upshot is that you can only run it on your CPU, not a GPU, which is an issue if you're already dealing with complex models and huge datasets, but shouldn't matter too much if you're just starting to tinker with Pytorch.
Upvotes: -1