tensorflow: While importing Tensorflow on CPU , a dynamic link library (DLL) initialization routine failed

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

binary

TensorFlow version

2.10

Custom code

No

OS platform and distribution

Windows 10 x64

Mobile device

No response

Python version

3.10

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

Microsoft Windows [Version 10.0.10240] © 2015 Microsoft Corporation. All rights reserved.

C:\Users\Samama>conda env list

conda environments:

base C:\Users\Samama\anaconda3 myenv C:\Users\Samama\anaconda3\envs\myenv

C:\Users\Samama>conda activate myenv

(myenv) C:\Users\Samama>conda list

packages in environment at C:\Users\Samama\anaconda3\envs\myenv:

Name Version Build Channel

_tflow_select 2.3.0 mkl abseil-cpp 20211102.0 hd77b12b_0 absl-py 2.1.0 py310haa95532_0 aiohttp 3.9.5 py310h2bbff1b_0 aiosignal 1.2.0 pyhd3eb1b0_0 astunparse 1.6.3 py_0 async-timeout 4.0.3 py310haa95532_0 attrs 23.1.0 py310haa95532_0 blas 1.0 mkl blinker 1.6.2 py310haa95532_0 brotli-python 1.0.9 py310hd77b12b_8 bzip2 1.0.8 h2bbff1b_6 c-ares 1.19.1 h2bbff1b_0 ca-certificates 2024.7.2 haa95532_0 cachetools 5.3.3 py310haa95532_0 certifi 2024.7.4 py310haa95532_0 cffi 1.16.0 py310h2bbff1b_1 charset-normalizer 3.3.2 pyhd3eb1b0_0 click 8.1.7 py310haa95532_0 colorama 0.4.6 py310haa95532_0 cryptography 41.0.3 py310h3438e0d_0 flatbuffers 2.0.0 h6c2663c_0 frozenlist 1.4.0 py310h2bbff1b_0 gast 0.4.0 pyhd3eb1b0_0 giflib 5.2.1 h8cc25b3_3 google-auth 2.29.0 py310haa95532_0 google-auth-oauthlib 0.4.4 pyhd3eb1b0_0 google-pasta 0.2.0 pyhd3eb1b0_0 grpc-cpp 1.48.2 hf108199_0 grpcio 1.48.2 py310hf108199_0 h5py 3.11.0 py310hed405ee_0 hdf5 1.12.1 h51c971a_3 icc_rt 2022.1.0 h6049295_2 icu 58.2 ha925a31_3 idna 3.7 py310haa95532_0 intel-openmp 2023.1.0 h59b6b97_46320 jpeg 9e h827c3e9_3 keras 2.10.0 py310haa95532_0 keras-preprocessing 1.1.2 pyhd3eb1b0_0 libcurl 8.7.1 h86230a5_0 libffi 3.4.4 hd77b12b_1 libpng 1.6.39 h8cc25b3_0 libprotobuf 3.20.3 h23ce68f_0 libssh2 1.10.0 hcd4344a_2 markdown 3.4.1 py310haa95532_0 markupsafe 2.1.3 py310h2bbff1b_0 mkl 2023.1.0 h6b88ed4_46358 mkl-service 2.4.0 py310h2bbff1b_1 mkl_fft 1.3.8 py310h2bbff1b_0 mkl_random 1.2.4 py310h59b6b97_0 multidict 6.0.4 py310h2bbff1b_0 numpy 1.26.4 py310h055cbcc_0 numpy-base 1.26.4 py310h65a83cf_0 oauthlib 3.2.2 py310haa95532_0 openssl 1.1.1w h2bbff1b_0 opt_einsum 3.3.0 pyhd3eb1b0_1 packaging 24.1 py310haa95532_0 pip 24.2 py310haa95532_0 protobuf 3.20.3 py310hd77b12b_0 pyasn1 0.4.8 pyhd3eb1b0_0 pyasn1-modules 0.2.8 py_0 pybind11-abi 5 hd3eb1b0_0 pycparser 2.21 pyhd3eb1b0_0 pyjwt 2.8.0 py310haa95532_0 pyopenssl 23.2.0 py310haa95532_0 pysocks 1.7.1 py310haa95532_0 python 3.10.0 h96c0403_3 python-flatbuffers 24.3.25 py310haa95532_0 re2 2022.04.01 hd77b12b_0 requests 2.32.3 py310haa95532_0 requests-oauthlib 2.0.0 py310haa95532_0 rsa 4.7.2 pyhd3eb1b0_1 scipy 1.13.1 py310h8640f81_0 setuptools 72.1.0 py310haa95532_0 six 1.16.0 pyhd3eb1b0_1 snappy 1.2.1 hcdb6601_0 sqlite 3.45.3 h2bbff1b_0 tbb 2021.8.0 h59b6b97_0 tensorboard 2.10.0 py310haa95532_0 tensorboard-data-server 0.6.1 py310haa95532_0 tensorboard-plugin-wit 1.8.1 py310haa95532_0 tensorflow 2.10.0 mkl_py310hd99672f_0 tensorflow-base 2.10.0 mkl_py310h6a7f48e_0 tensorflow-estimator 2.10.0 py310haa95532_0 termcolor 2.1.0 py310haa95532_0 tk 8.6.14 h0416ee5_0 typing_extensions 4.11.0 py310haa95532_0 tzdata 2024a h04d1e81_0 urllib3 2.2.2 py310haa95532_0 vc 14.40 h2eaa2aa_0 vs2015_runtime 14.40.33807 h98bb1dd_0 werkzeug 3.0.3 py310haa95532_0 wheel 0.43.0 py310haa95532_0 win_inet_pton 1.1.0 py310haa95532_0 wrapt 1.14.1 py310h2bbff1b_0 xz 5.4.6 h8cc25b3_1 yarl 1.9.3 py310h2bbff1b_0 zlib 1.2.13 h8cc25b3_1

(myenv) C:\Users\Samama>python Python 3.10.0 | packaged by conda-forge | (default, Nov 10 2021, 13:20:59) [MSC v.1916 64 bit (AMD64)] on win32 Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow Traceback (most recent call last): File “C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 62, in <module> from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow_init_.py”, line 37, in <module> from tensorflow.python.tools import module_util as module_util File "C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python_init.py", line 36, in <module> from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow File “C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 77, in <module> raise ImportError( ImportError: Traceback (most recent call last): File “C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 62, in <module> from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.

Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common causes and solutions. If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.

Standalone code to reproduce the issue

import tensorflow

Relevant log output

Traceback (most recent call last):
  File "C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 62, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\__init__.py", line 36, in <module>
    from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
  File "C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 77, in <module>
    raise ImportError(
ImportError: Traceback (most recent call last):
  File "C:\Users\Samama\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 62, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.


Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error message.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (3 by maintainers)

Most upvoted comments

Any way out please?

Looking into it , will surely update you if I find something