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

Using python sdist to create a package that includes generated files in the build directory
Any elegant way to add a method to an existing object in python?
Setting cookies for static files using bottle.py
Python/Feedparser: reading RSS feed fails
How to generate a Torrent Magnet URI from a directory?
Python/Kivy camera widget error with opencv
Python3 - When exactly do you need to prepend “self._” to variable declarations within class methods? [duplicate]
how to tell python 3 to skip over non-digit characters from a csv file
writing numpy codes in cython with unknown dimensions
How to refresh django connection when inserting in SQL
How to get this enum if I only have a string representation in Python 2.7
How to escape Unicode in Python 3
Performance of timezone-aware Pandas DateTimeIndex
How to remove single space between text
Writing out results with function in.txt document when there's min and max?
Not understanding why I cant use use cx_Oracle with Django

Categories

HOME
cakephp-3.x
cluster-computing
sass
xamarin.android
bing
backup
jasmine
wxwidgets
amazon-product-api
laravel-4
tizen-wearable-sdk
subquery
xamarin-studio
tee
public-key-encryption
cs-cart
nuxt.js
glpk
spring-cloud-config
derived
propel2
tweets
cvs2svn
sonarqube-msbuild-runner
plsqldeveloper
countif
avplayeritem
python-textprocessing
version-numbering
dpi
bitcoin-testnet
ifstream
fabric-digits
recurrence-relation
pox
lego
readfile
sonarqube-scan
android-maps-v2
pytest-django
stress-testing
encapsulation
mbaas
scd
cdk
python-hypothesis
laravel-query-builder
keycode
update-site
gitweb
coordinate-transformation
asp.net-mvc-partialview
supportmapfragment
amazon-kcl
license-key
insert-into
vips
prezto
twitter-rest-api
isml
shift-jis
uptodate
custom-url
obfuscar
java-melody
log4cplus
surrogate-key
json-patch
android-json-rpc
justgage
manage.py
sharpmap
qtgui
android-contextmenu
domain-calculus
code-conversion
attachevent
usn
qsqltablemodel
couchdb-lucene
javascriptserializer
xgettext
n-layer
xmlslurper
gdt
windows-phone-7-emulator
applicationcontext
signals2
electronic-signature
paintcomponent
ets
querypath
hibernate3-maven-plugin
file-encodings
linfu
pci-bus
filetime
lazy-c++
weborb
interface-design

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