tensorflow: TensorFlow DLL failed to load with newer version of TF

Issue type

Build/Install

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

tf 2.19.0

Custom code

Yes

OS platform and distribution

Windows 11 64-bit

Mobile device

No response

Python version

3.11

Bazel version

No response

GCC/compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

ImportError: Traceback (most recent call last): File “C:\Users\adity\AppData\Roaming\Python\Python311\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 73, 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.

Standalone code to reproduce the issue

NA

Relevant log output


About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 41 (7 by maintainers)

Most upvoted comments

Hello, Instead of using conda, is there a way to install the vc dependency using pip?

Actually I don’t know how to download them by pip. May could not download them by pip Here you can try the two approaches(you just need choose one):

About this problem, it’s actully caused by your vc and vs2015-runtime are too old when you are specially using anaconda follow these steps, and you could import it correctly.

conda remove vs2015_runtime vc --force
conda clean --index-cache
conda install -c anaconda vs2015_runtime vc

then you can import it.

(base) C:\Users\ASUS>python
Python 3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2025-07-14 20:58:19.655584: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2025-07-14 20:58:32.645012: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
>>> tf.__version__
'2.19.0'
>>>

here list my version of vc and vs2015-runtime

vc-14.3                   
vc14_runtime-14.44.35208  
vs2015_runtime-14.44.35208

Attention: you needn’t install Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.44.35211 and Microsoft Visual C++ 2015-2022 Redistributable (x86) - 14.44.35211 locally on your computer. Just install the above packages in the anaconda environmet

@Venkat6871 Thanks for replying! Tensorflow working fine day before failing. My device has 64-bit architecture. I got error while executing code - ImportError: Traceback (most recent call last): File “C:\Users\adity\AppData\Roaming\Python\Python311\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 73, 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.

so I uninstall current tensorflow lib and install it again but error was still there, then I installed tensorflow version 2.16.2. it worked. when i install tensorfloe_hub it upgrade the tensrflow and got dependencies issue.

Hey! I would like to try to help

I run dlltracer got a log file. Find attached file below. I run it for version 2.19.0

log.txt