Skip to content Skip to sidebar Skip to footer

Tensorflow : Importerror: Dll Load Failed

I am using Windows 10, Python 3.7.8 and PyCharm. First, I installed Python 3.7.8. Then I installed PyCharm. I am trying to run Python code, to be specific Tensorflow code. I follow

Solution 1:

SHORT ANSWER

According to this thread : https://github.com/tensorflow/tensorflow/issues/35618#issuecomment-596631286

downloading that lastest microsoft redistributable C++ from here :

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

will solve your problem

EXTRA 1 : Use Docker as a Python Interpreter in Pycharm

Pycharm has a usefull tool that I personally use all the time : Docker as an interpreter.

This implies to install Docker but once you got it, you can download pretty much all the images with dependecies pre-installed and ready for work !

In your case :

  1. If you dont have it Download Docker for windows (https://hub.docker.com/editions/community/docker-ce-desktop-windows/)

  2. Run this command from you cmd : docker pull tensorflow/tensorflow

  3. check that you have the tensorflow image by running docker images command. you should get this output :

enter image description here

  1. Open new project in pycharm

  2. go to Setting | Project | Project interpreter

  3. Click on the three vertical dots to Add a new interpreter

  4. you should get to this window (on the left click on "Docker"): enter image description here

  5. click on "OK"

And Let's code !

Now if you need another big dependecy like this one, you can always reproduce those steps with the specific dependency image from docker hub

For further details, here is the official tutorial from JetBrains : How to make Docker container as an interpreter in PyCharm

EXTRA 2 : Use Docker as a Python Interpreter in VSCode

For some of users that using python in VSCode (I personally don't), I've found those steps to achieve the same configuration (Docker as python interpreter) in VSCode :

  1. Install the Python extension

  2. Install the Remote - Containers extension

  3. Open the Command Pallette and type Remote-Containers, then select the Attach to Running Container... and selecet the running docker container

  4. VS Code will restart and reload

  5. On the Explorer sidebar, click the open a folder button and then enter /code (this will be loaded from the remote container)

  6. On the Extensions sidebar, select the Python extension and install it on the container

  7. Whenprompet on which interppreter to use, select /usr/local/bin/python

  8. Open the Command Pallette and type Python: Configure Tests, then select the unittest framework

    Source for this part : Setting Up a Python Remote Interpreter Using Docker

Post a Comment for "Tensorflow : Importerror: Dll Load Failed"