ImportError: DLL load failed: 找不到指定的模块

Mr::Z:: 提问于 7个月前

刚听说pytorch支持windows了,马上来试试。谁知道还是不行...

报错:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\pydev_run_in_console.py", line 52, in run_file
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/mr_z/Desktop/py/_.py", line 2, in <module>
    import torch
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\mr_z\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\__init__.py", line 78, in <module>
    from torch._C import *
  File "C:\Program Files\JetBrains\PyCharm 2018.1.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: 找不到指定的模块。


代码:

from __future__ import print_function
import torch

x = torch.rand(5, 3)
print(x)
回答 2
2 个回答
7个月前

你哪个版本?

回复 · 1
Mr::Z:: 回复 Jacqueline 7个月前 回复
Python3.6.4 还不知道支持不支持,今天才出的pytorch 0.4

肯定是你打开的方式不对

回复 · 2
Mr::Z:: 回复 Ξ魂牵梦萦Ξ 4个月前 回复
还是不可以,我重装试试
Mr::Z:: 回复 Ξ魂牵梦萦Ξ 4个月前 回复
试过了很多遍都没用,还是老老实实用anaconda + spyder吧。谢谢啦
需要登录后才能回答,快点击 来分享你的回答吧~
0 关注
0 收藏,229 浏览
邀请回答
分享到