'Python 3.7.3 and Tensorflow 15.2 runtime error
I have python 3.7.3 and Tensorflow 15.2 installed in raspberry pi 4. When I tried to do import Tensorflow as TD, it failed to load the native Tensorflow runtimes. I got the import error undefined symbol: _PyThreadState_current
pi@raspberrypi:~ $ python Python 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import tensorflow as tf Traceback (most recent call last): File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/usr/lib/python3.7/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/lib/python3.7/imp.py", line 342, in load_dynamic return _load(spec) ImportError: /home/pi/.local/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: _PyThreadState_Current
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/init.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/init.py", line 49, in from tensorflow.python import pywrap_tensorflow File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/home/pi/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/usr/lib/python3.7/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/lib/python3.7/imp.py", line 342, in load_dynamic return _load(spec) ImportError: /home/pi/.local/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so: undefined symbol: _PyThreadState_Current
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.
Can you please help and advice how to resolve this issue?
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
