ImportError: DLL load failed while importing _pywrap_tensorflow_internal

Hi All,
in the next few days, I’m planning to take the Tensorflow Developer exam, but in the meantime, I’m facing an error in my Pycharm environment:
ImportError: DLL load failed while importing _pywrap_tensorflow_internal

I followed the guide “Setting_Up_TF_Developer_Certificate_Exam” (Last Updated: July 12 2022).
I installed:

  • PyCharm 2021.3 (Community Edition)
  • Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]

My O.S. is Windows 11 Home (10.0.22000 build 22000)

Below is the complete error message when I try to run: “import tensorflow as tf”:
Traceback (most recent call last):

  • File “C:\Users\savin\PycharmProjects\TFExam_test\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 62, in *
  • from tensorflow.python._pywrap_tensorflow_internal import **
    ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Impossibile trovare il modulo specificato.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  • File “C:/Users/savin/PycharmProjects/TFExam_test/main.py”, line 1, in *
  • import tensorflow as tf*
  • File “C:\Users\savin\PycharmProjects\TFExam_test\venv\lib\site-packages\tensorflow_init_.py”, line 37, in *
  • from tensorflow.python.tools import module_util as _module_util*
  • File “C:\Users\savin\PycharmProjects\TFExam_test\venv\lib\site-packages\tensorflow\python_init_.py”, line 36, in *
  • from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow*
  • File “C:\Users\savin\PycharmProjects\TFExam_test\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 77, in *
  • raise ImportError(*
    ImportError: Traceback (most recent call last):
  • File “C:\Users\savin\PycharmProjects\TFExam_test\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 62, in *
  • from tensorflow.python._pywrap_tensorflow_internal import **
    ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Impossibile trovare il modulo specificato.

Failed to load the native TensorFlow runtime.
See Build and install error messages  |  TensorFlow for some common causes and solutions.
If you need help, create an issue at Issues · tensorflow/tensorflow · GitHub and include the entire stack trace above this error message.

which version of tensorflow are you using ?

Have you installed the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, and 2019 ?

If not, please install the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, and 2019. because starting from the TensorFlow 2.1.0 version, the msvcp140_1.dll file is required from this package (which may not be provided from older redistributable packages). The redistributable comes with Visual Studio 2019 but can be installed separately:

  1. Go to the Microsoft Visual C++ downloads.
  2. Scroll down the page to the Visual Studio 2015, 2017 and 2019 section.
  3. Download and install the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 for your platform.

Make sure long paths are enabled on Windows.