py3.7 张量流 找不到指定的模块



如上所述,我在导入张量流时遇到问题。 以下是带有 IDLE 的输出:

Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] on win32     
Type "help", "copyright", "credits" or "license()" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepythonpywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepythonpywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepythonpywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libimp.py", l
ine 242, in load_module
return load_dynamic(name, filename, file)
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libimp.py", l
ine 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import tensorflow as tf
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_core__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow__init__.py", line 50, in __getattr__
module = self._load()
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libimportlib__init__.py", line 1
27, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepython__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepythonpywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepythonpywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepythonpywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libsite-packa
gestensorflow_corepythonpywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libimp.py", line 2
42, in load_module
return load_dynamic(name, filename, file)
File "C:Userssungn_000AppDataLocalProgramsPythonPython37libimp.py", line 3
42, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

我使用的是Windows 8.1 64位,Python 3.7。使用 pip 安装张量流 2.1.0。 看到一些GitHub问题和一些Stack Overflow问题,但没有一个解决问题。 没有安装 CUDA 或其他东西。这有效吗? 这有什么问题??

编辑抱歉,使用 Anaconda 安装了 Tensorflow(最新(。在其中营造了一个环境。

**

您需要为Tensorflow设置第一个虚拟环境

**

然后

点子安装 --升级张量流

安装后,请验证安装:

Python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000](((">

最新更新