CaptanJag
CaptanJag

Reputation: 1

ImportError: DLL load failed: The specified module could not be found. (Torch issues)

I am pretty new to python (not so new to java). I am very interested in the AI/Machine learning aspect of python.. So I went to Udemy and got two courses.. One on python and another on AI. I fooled around with the python course then went to the AI course. One of the imports needed was (torch) So I installed the import via the anaconda prompt.. I tried to run the import and I got the error

Traceback (most recent call last):
  File "C:\Users\lukem\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3267, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-4-eb42ca6e4af3>", line 1, in <module>
    import torch
  File "C:\Program Files\JetBrains\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\lukem\Anaconda3\lib\site-packages\torch\__init__.py", line 84, in <module>
    from torch._C import *
  File "C:\Program Files\JetBrains\PyCharm 2018.3.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: The specified module could not be found.

I then tried MANY versions of python and different ways of installing torch (pip3/cond) nothing worked.. I then uninstalled everything and all of a sudden the base import torch worked but things like (import torch.n or random) didnt work. Then all of a sudden the import torch wasn't there. Makes sense since I did uninstall everything involving torch. Current situation is I have torch downloaded

pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1-cp37-cp37m-win_amd64.whl

and that gives me the error listed above.. I am just very stuck and I've literal wasted around 3 days searching and trying to figure everything out in general (Had issues with tensor and python versions ect)

Hopefully this all makes sense.. I've only posted on stackoverflow once before.

Upvotes: 0

Views: 2496

Answers (1)

user11073865
user11073865

Reputation: 1

change init.py (https://github.com/pytorch/pytorch/issues/17203) or please downgrade your python to 3.7.1(or 3.6.7)

Upvotes: 0

Related Questions