python


tensorflow import does not work


In the python shell when I type
import tensorflow as tf
the script breaks. It fails to load the native runtime. I am using python 3.5.2. Here is the error log:
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Program Files\Python35\lib\importlib\__init__.py", line 126, in impor
t_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 906, in create_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow_internal.py", line 21, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "C:\Program Files\Python35\lib\importlib\__init__.py", line 126, in impor
t_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files\Python35\lib\site-packages\tensorflow\__init__.py", lin
e 24, in <module>
from tensorflow.python import *
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\__init__.p
y", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Program Files\Python35\lib\importlib\__init__.py", line 126, in impor
t_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 906, in create_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow_internal.py", line 21, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\pywrap_ten
sorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "C:\Program Files\Python35\lib\importlib\__init__.py", line 126, in impor
t_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
Any suggestions?
I once faced this issue and got it solved by installing the Visual C++ Redistributable.
Refer to this issue in github. It was quite helpful for me.

Related Links

What does the Mayavi contour3d docs mean when it refers to “the arrows”?
Which python module is handy for simple 2-dimension graphic demonstration task?
Why does numpy.polyfit return non-zero values for straight line data?
AttributeError: 'FeatureChartParser' object has no attribute 'nbest_parse'
How to get type of the file from the Google Cloud Storage based on its blobkey?
Custom collections in SQL Alchemy
SqlAlchemy + MySql 1205, 'Lock wait timeout exceeded; try restarting transaction'
Getting the float numbers from this string (Python)
Django function calls
How do I limit the amount of values in a list - Python 3
While loops and duplicate code in python
egg package import error in python project deploy
Having trouble installing the Quartz python module
How to specify list size using FactoryBoy
Redirect a part of traffic to other server
How to use a Chat script on a LAN?

Categories

HOME
arrays
crystal-reports
google-sheets-api
actionscript
automated-tests
rocketmq
algorithmic-trading
xcode8.3
lotus-notes
powershell-v3.0
xlsx
game-physics
cross-platform
arraylist
kitematic
skmaps
osmdroid
lync-2013
emv
spring-data-neo4j
dhtmlx-scheduler
percentage
data-extraction
codesys
lexical-analysis
tripwire
control-flow-graph
jrules
floor
ideone
webdatagrid
rhel6
greenhills
rpostgresql
lotus
barcode-printing
pdflib
c64
vst
json-schema-validator
coordinate-transformation
multinomial
enyo
matcaffe
abas
ffserver
gray-code
rspec3
pgm
custom-url
consensus
hana-xs
lexicographic
kallithea
adcolony
dalekjs
coin-flipping
android-looper
data-generation
httpcontext
voldemort
arangodb-php
baucis
document-database
windows-mobile-6
modeshape
nsmatrix
facebook-sdk-3.1
manage.py
abnf
angularjs-timeout
mozart-mvc
usn
vim-powerline
xgettext
mysql-error-1045
hibernate3-maven-plugin
gwt-2.2-celltable
aio
iphone-sdk-3.2
associativity

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App