记录一下解决Tensorflow安装成功,但在导入时报错的问题

C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\Scripts\python.exe E:/work/浏览器下载/指纹+人脸/PyQt5_Face_Recognition-master/face_recognition.py
Traceback (most recent call last):
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:/work/浏览器下载/指纹+人脸/PyQt5_Face_Recognition-master/face_recognition.py", line 6, in
    import tensorflow as tf
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow\__init__.py", line 101, in
    from tensorflow_core import *
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\__init__.py", line 40, in
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
    module = self._load()
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow\__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。


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.

Process finished with exit code 1

解决方法:可以重新安装 出现其他问题如

出现importError: DLL load failed: 找不到指定的模块。python3.7(1)

见https://blog.csdn.net/sereasuesue/article/details/105327611

TensorFlow2.1导入问题(2) Could not load dynamic library 'cudart64_101.dll'安装前必看

https://blog.csdn.net/sereasuesue/article/details/105327611但是如果你安装不是gpu或者不想使用gpu加速可以忽略此问题

你可能感兴趣的:(Python,深度学习)