On importing tensorflow as if in the jupyter notebook it is showing the following error

this is the error:-
ImportError Traceback (most recent call last)
in
----> 1 import tensorflow as tf

c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow_init_.py in
39 import sys as _sys
40
—> 41 from tensorflow.python.tools import module_util as _module_util
42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
43

c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python_init_.py in
38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
39
—> 40 from tensorflow.python.eager import context
41
42 # pylint: enable=wildcard-import

c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\eager\context.py in
33 from tensorflow.core.protobuf import config_pb2
34 from tensorflow.core.protobuf import rewriter_config_pb2
—> 35 from tensorflow.python import pywrap_tfe
36 from tensorflow.python import tf2
37 from tensorflow.python.client import pywrap_tf_session

c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\pywrap_tfe.py in
26
27 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import
—> 28 from tensorflow.python import pywrap_tensorflow
29 from tensorflow.python._pywrap_tfe import *

c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
26
27 # Perform pre-load sanity checks in order to produce a more actionable error.
—> 28 self_check.preload_check()
29
30 # pylint: disable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\platform\self_check.py in preload_check()
59 '2019" for your platform from this URL: ’
60 “https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads
—> 61 % " or ".join(missing))
62 else:
63 # TODO(mrry): Consider adding checks for the Linux and Mac OS X builds.

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

How can I resolve it?

hey @jsrishty ,
Tensorflow requires some special .dll files to work with system resources.
and to get these dll files , we need to install Microsoft C++ Redistributable for Visual Studio 2015 as it has been stated in the error too.

So , kindly just install it and then try again.

I hope this helps.

ImportError Traceback (most recent call last) c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 63 try: —> 64 from tensorflow.python.pywrap_tensorflow_internal import * 65 # This try catch logic is because there is no bazel equivalent for py_extension. ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. During handling of the above exception, another exception occurred: ImportError Traceback (most recent call last) in ----> 1 import tensorflow as tf c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow_init.py in 39 import sys as _sys 40 —> 41 from tensorflow.python.tools import module_util as _module_util 42 from tensorflow.python.util.lazy_loader import LazyLoader as LazyLoader 43 c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python_init.py in 38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top 39 —> 40 from tensorflow.python.eager import context 41 42 # pylint: enable=wildcard-import c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\eager\context.py in 33 from tensorflow.core.protobuf import config_pb2 34 from tensorflow.core.protobuf import rewriter_config_pb2 —> 35 from tensorflow.python import pywrap_tfe 36 from tensorflow.python import tf2 37 from tensorflow.python.client import pywrap_tf_session c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\pywrap_tfe.py in 26 27 # pylint: disable=invalid-import-order,g-bad-import-order, wildcard-import, unused-import —> 28 from tensorflow.python import pywrap_tensorflow 29 from tensorflow.python._pywrap_tfe import * c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 81 for some common reasons and solutions. Include the entire stack trace 82 above this error message when asking for help.""" % traceback.format_exc() —> 83 raise ImportError(msg) 84 85 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long ImportError: Traceback (most recent call last): File “c:\users\jpriy\appdata\local\programs\python\python37\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 64, in from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed: 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 reasons and solutions. Include the entire stack trace above this error message when asking for help. Now It is showing this how can I resolve this?

hey @jsrishty ,
Can you please let me know , your python version and tensorflow version that your downloaded.

python 3.7.4
tensorflow: 2.3.1

kindly lower your tensorflow version.
try using tensorflow 1.5.10


I am not able to download tensorflow 1.5.10 version

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.