TensorFlow ImportError: undefined symbol: _ZTIN6snappy4SinkE

I’m trying to import TensorFlow in my conda Python environment, but I’m encountering the following error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import tensorflow as tf
2 device_name = tf.test.gpu_device_name()
4 if device_name != "/device:GPU:0":
File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/__init__.py:40
37 import typing as _typing
39 # Do not remove this line; See https://github.com/tensorflow/tensorflow/issues/42596
---> 40 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/pywrap_tensorflow.py:34
29 from tensorflow.python.platform import self_check
31 # TODO(mdan): Cleanup antipattern: import for side effects.
32
33 # Perform pre-load sanity checks in order to produce a more actionable error.
---> 34 self_check.preload_check()
36 # pylint: disable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
38 try:
39 # This import is expected to fail if there is an explicit shared object
40 # dependency (with_framework_lib=true), since we do not need RTLD_GLOBAL.
File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/platform/self_check.py:63, in preload_check()
50 raise ImportError(
51 "Could not find the DLL(s) %r. TensorFlow requires that these DLLs "
52 "be installed in a directory that is named in your %%PATH%% "
(...)
56 "https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads"
57 % " or ".join(missing))
58 else:
59 # Load a library that performs CPU feature guard checking. Doing this here
60 # as a preload check makes it more likely that we detect any CPU feature
61 # incompatibilities before we trigger them (which would typically result in
62 # SIGILL).
---> 63 from tensorflow.python.platform import _pywrap_cpu_feature_guard
64 _pywrap_cpu_feature_guard.InfoAboutUnusedCPUFeatures()
ImportError: /home/gimhara/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/platform/../../libtensorflow_framework.so.2: undefined symbol: _ZTIN6snappy4SinkE
</code>
<code>--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[2], line 1 ----> 1 import tensorflow as tf 2 device_name = tf.test.gpu_device_name() 4 if device_name != "/device:GPU:0": File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/__init__.py:40 37 import typing as _typing 39 # Do not remove this line; See https://github.com/tensorflow/tensorflow/issues/42596 ---> 40 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import 41 from tensorflow.python.tools import module_util as _module_util 42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/pywrap_tensorflow.py:34 29 from tensorflow.python.platform import self_check 31 # TODO(mdan): Cleanup antipattern: import for side effects. 32 33 # Perform pre-load sanity checks in order to produce a more actionable error. ---> 34 self_check.preload_check() 36 # pylint: disable=wildcard-import,g-import-not-at-top,unused-import,line-too-long 38 try: 39 # This import is expected to fail if there is an explicit shared object 40 # dependency (with_framework_lib=true), since we do not need RTLD_GLOBAL. File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/platform/self_check.py:63, in preload_check() 50 raise ImportError( 51 "Could not find the DLL(s) %r. TensorFlow requires that these DLLs " 52 "be installed in a directory that is named in your %%PATH%% " (...) 56 "https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads" 57 % " or ".join(missing)) 58 else: 59 # Load a library that performs CPU feature guard checking. Doing this here 60 # as a preload check makes it more likely that we detect any CPU feature 61 # incompatibilities before we trigger them (which would typically result in 62 # SIGILL). ---> 63 from tensorflow.python.platform import _pywrap_cpu_feature_guard 64 _pywrap_cpu_feature_guard.InfoAboutUnusedCPUFeatures() ImportError: /home/gimhara/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/platform/../../libtensorflow_framework.so.2: undefined symbol: _ZTIN6snappy4SinkE </code>
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import tensorflow as tf
2 device_name = tf.test.gpu_device_name()
4 if device_name != "/device:GPU:0":
File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/__init__.py:40
37 import typing as _typing
39 # Do not remove this line; See https://github.com/tensorflow/tensorflow/issues/42596
---> 40 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/pywrap_tensorflow.py:34
29 from tensorflow.python.platform import self_check
31 # TODO(mdan): Cleanup antipattern: import for side effects.
32
33 # Perform pre-load sanity checks in order to produce a more actionable error.
---> 34 self_check.preload_check()
36 # pylint: disable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
38 try:
39 # This import is expected to fail if there is an explicit shared object
40 # dependency (with_framework_lib=true), since we do not need RTLD_GLOBAL.
File ~/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/platform/self_check.py:63, in preload_check()
50 raise ImportError(
51 "Could not find the DLL(s) %r. TensorFlow requires that these DLLs "
52 "be installed in a directory that is named in your %%PATH%% "
(...)
56 "https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads"
57 % " or ".join(missing))
58 else:
59 # Load a library that performs CPU feature guard checking. Doing this here
60 # as a preload check makes it more likely that we detect any CPU feature
61 # incompatibilities before we trigger them (which would typically result in
62 # SIGILL).
---> 63 from tensorflow.python.platform import _pywrap_cpu_feature_guard
64 _pywrap_cpu_feature_guard.InfoAboutUnusedCPUFeatures()
ImportError: /home/gimhara/anaconda3/envs/tf-env/lib/python3.11/site-packages/tensorflow/python/platform/../../libtensorflow_framework.so.2: undefined symbol: _ZTIN6snappy4SinkE

I’m using Python 3.11 and TensorFlow v2.15.0 installed in an Anaconda environment on Ubuntu 22.04.

From my research, this error seems to be related to a missing or incompatible version of the Snappy compression library used by TensorFlow.

I’ve tried the following steps to resolve the issue:

  1. Reinstalling TensorFlow using pip and conda.

  2. Installing the libsnappy-dev package on Ubuntu.

However, none of these steps have resolved the issue so far.

Can anyone provide guidance on how to properly resolve this ImportError and get TensorFlow running correctly?

Please let me know if you need any additional information or if I should provide more details about my setup or the steps I’ve taken so far.

Thank you in advance for your help!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật