我试图在我的Jupyter Notebook中导入tensorflow模块,但是却出现了以下长时间错误,而且似乎没有意识到原因。
代码:
import tensorflow as tf
print("Done")
错误:
<ipython-input-12-64156d691fe5> in <module>
----> 1 import tensorflow as tf
~\anaconda3\lib\site-packages\tensorflow\__init__.py in <module>
39 import sys as _sys
40
---> 41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
43
~\anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>
46 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
47
---> 48 import numpy as np
49
50 from tensorflow.python import pywrap_tensorflow
~\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py in <module>
138
139 # Allow distributors to run custom init code
--> 140 from . import _distributor_init
141
142 from . import core
~\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py in <module>
24 # NOTE: would it change behavior to load ALL
25 # DLLs at this path vs. the name restriction?
---> 26 WinDLL(os.path.abspath(filename))
27 DLL_filenames.append(filename)
28 if len(DLL_filenames) > 1:
~\anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
362
363 if handle is None:
--> 364 self._handle = _dlopen(self._name, mode)
365 else:
366 self._handle = handle
OSError: [WinError 193] %1 is not a valid Win32 application
注意:这是代码中的唯一一行。 如果有人可以帮助我,那将真的很有帮助。预先感谢。
系统: Anaconda(64位) Python(也作为64位运行)
我不确定这不是32 vs 64问题。