火炬NameError:未定义名称“ _C”

时间:2019-02-13 21:47:22

标签: cython jupyter pytorch

在Jupyter中尝试import torch时遇到以下错误:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-10-39178> in <module>
      1 
----> 2 import torch

~/jupyter_py3/lib/python3.6/site-packages/torch/__init__.py in <module>
     84 from torch._C import *
     85 
---> 86 __all__ += [name for name in dir(_C)
     87             if name[0] != '_' and
     88             not name.endswith('Base')]

NameError: name '_C' is not defined


     88             not name.endswith('Base')]

NameError: name '_C' is not defined

Cython已经安装,以防万一。

有什么解决方法吗?

0 个答案:

没有答案