简体   繁体   English

ImportError:dlopen(...):未加载库:@rpath/_pywrap_tensorflow_internal.so

[英]ImportError: dlopen(...): Library not loaded: @rpath/_pywrap_tensorflow_internal.so

I am a beginner at machine learning.我是机器学习的初学者。 I try to use LSTM algorism but when I write我尝试使用 LSTM 算法但是当我写

from keras.models import Sequential

it shows error as below:它显示如下错误:

ImportError: dlopen(/Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/python/_pywrap_tfe.so, 2): Library not loaded: @rpath/_pywrap_tensorflow_internal.so
  Referenced from: /Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/python/_pywrap_tfe.so
  Reason: image not found

How can I fix this?我怎样才能解决这个问题? Thank you so much!太感谢了!

full error message:完整的错误信息:

Traceback (most recent call last):
  File "/Users/wangzifan/Desktop/machine/LSTM.py", line 39, in <module>
    from keras.models import Sequential
  File "/Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/keras/__init__.py", line 21, in <module>
    from tensorflow.python import tf2
  File "/Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/python/__init__.py", line 37, in <module>
    from tensorflow.python.eager import context
  File "/Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/python/eager/context.py", line 33, in <module>
    from tensorflow.python import pywrap_tfe
  File "/Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/python/pywrap_tfe.py", line 25, in <module>
    from tensorflow.python._pywrap_tfe import *
ImportError: dlopen(/Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/python/_pywrap_tfe.so, 2): Library not loaded: @rpath/_pywrap_tensorflow_internal.so
  Referenced from: /Users/wangzifan/opt/anaconda3/lib/python3.9/site-packages/tensorflow/python/_pywrap_tfe.so
  Reason: image not found

Problem solved.问题解决了。 install tensorflow again with再次安装 tensorflow

sudo pip3 install tensorflow

and change the import to并将导入更改为

from tensorflow.python.keras.models import Sequential

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 规则&#39;//tensorflow/python:_pywrap_tensorflow_internal.so&#39;的链接失败 - Linking of rule '//tensorflow/python:_pywrap_tensorflow_internal.so' failed 张量流导入错误:_pywrap_tensorflow_internal.so:未定义符号:PyClass_Type - tensorflow import error: _pywrap_tensorflow_internal.so: undefined symbol: PyClass_Type ImportError:dlopen(/Library/Python/2.7/site-packages/lxml/etree.so,2):库未加载:@ rpath / libxslt.1.dylib - ImportError: dlopen(/Library/Python/2.7/site-packages/lxml/etree.so, 2): Library not loaded: @rpath/libxslt.1.dylib ImportError:没有名为“ _pywrap_tensorflow_internal”的模块 - ImportError: No module named '_pywrap_tensorflow_internal' BigQuery ImportError:未加载 Dlopen(...) 库 - BigQuery ImportError: Dlopen(...) library not loaded Tensorflow ImportError:Windows 10上没有名为“_pywrap_tensorflow_internal”的模块 - Tensorflow ImportError: No module named '_pywrap_tensorflow_internal' on Windows 10 ImportError:在Python 3.5上没有名为“ _pywrap_tensorflow_internal”的模块 - ImportError: No module named '_pywrap_tensorflow_internal' at python 3.5 如何修复“ImportError:没有名为&#39;_pywrap_tensorflow_internal&#39;的模块” - How to fix “ImportError: No module named '_pywrap_tensorflow_internal'” 导入错误:Python 3.8 中没有名为“_pywrap_tensorflow_internal”的模块 - ImportError: No module named '_pywrap_tensorflow_internal' with Python 3.8 ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 动态链接库 (DLL) 初始化例程失败 - ImportError: DLL load failed while importing _pywrap_tensorflow_internal:A dynamic link library (DLL) initialization routine failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM