13

I am currently trying to pip install tensorflow, which works but after I install it, and then import it into my python module via import tensorflow as tf I get following error message:

ImportError: Could not find the DLL(s) 'msvcp140_1.dll'. TensorFlow requires that
these DLLs be installed in a directory that is named in your %PATH% environment
variable. You may install these DLLs by downloading "Microsoft C++ Redistributable
for Visual Studio 2015, 2017 and 2019" for your platform from this URL: 
https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads

I installed the msvcp140_1.dll and put it into C:\Users\User\AppData\Local\Programs\Python\Python37 which is contained in my path environment variable.

As you can see I am using Python 3.7 as 3.8 is not supported by tensorflow. Any ideas how to fix this?

Mark Jacobsen
  • 341
  • 1
  • 4
  • 14

4 Answers4

9

You can find msvcp140.dll in your %windows%/System32 folder, once you installed VC++ DIST for VS 2015, for msvcp140_1.dll you need to goto this page

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

and in the section :Visual Studio 2015, 2017 and 2019, pick the correct package with the arch of your PC.

KingQQ
  • 173
  • 2
9

Just click this link https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Then install

x64: vc_redist.x64.exe

and restart your pc.

1

I recommend you this setup tutorial, it works on my computer. And you need python 3.6 for Tensorflow instead of 3.7.

https://github.com/jeffheaton/t81_558_deep_learning/blob/master/manual_setup.ipynb

Brian
  • 19
  • 2
0

In my case, Downloading Visual C++ from the url below works.

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

Yashi Aggarwal
  • 407
  • 2
  • 6