<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: No.  import tensorflow as tf</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Windows 10 x64 on SQL Server 2017</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: Binary - pip install N:\Packages\Python\tensorflow-1.8.0-cp35-cp35m-win_amd64.whl -f ./ --no-index</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.8.0</li>
<li><strong>Python version</strong>: 3.5</li>
<li><strong>Bazel version (if compiling from source)</strong>: N/A</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: N/A</li>
<li><strong>CUDA/cuDNN version</strong>: N/A</li>
<li><strong>GPU model and memory</strong>: N/A</li>
<li><strong>Exact command to reproduce</strong>:  import tensorflow as tf</li>
</ul>
<p dir="auto">running through sql the full code is:</p>
<p dir="auto">EXECUTE sp_execute_external_script<br>
<a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/language/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/language">@language</a>=N'Python',<br>
<a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/script/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/script">@script</a> = N'<br>
import tensorflow as tf<br>
'</p>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">All dependencies for tensorflow 1.8.0 are installed.<br>
Installation through pip ends with "Successfully installed tensorflow-1.8.0"</p>
<p dir="auto">Attempting to import tensorflow fails with:<br>
Msg 39019, Level 16, State 2, Line 7<br>
An external script error occurred:<br>
Failed to load the native TensorFlow runtime.</p>
<p dir="auto">Full error report below.</p>
<p dir="auto">I have checked that MSVCP140.DLL exists in System32 and in SysWOW64.<br>
I don't know how to check for an AVX issue or to bypass it.</p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">Traceback (most recent call last):<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper<br>
return importlib.import_module(mname)<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_<em>init</em>_.py", line 126, in import_module<br>
return _bootstrap._gcd_import(name[level:], package, level)<br>
File "", line 986, in _gcd_import<br>
File "", line 969, in _find_and_load<br>
File "", line 958, in _find_and_load_unlocked<br>
File "", line 666, in _load_unlocked<br>
File "", line 577, in module_from_spec<br>
File "", line 906, in create_module<br>
File "", line 222, in _call_with_frames_removed</p>
<p dir="auto">Msg 39019, Level 16, State 2, Line 7<br>
An external script error occurred:<br>
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.</p>
<p dir="auto">During handling of the above exception, another exception occurred:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <br>
from tensorflow.python.pywrap_tensorflow_internal import *<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in <br>
_pywrap_tensorflow_internal = swig_import_helper()<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper<br>
return importlib.import_module('<em>pywrap_tensorflow_internal')<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_<em>init</em></em>.py", line 126, in import_module<br>
return _bootstrap._gcd_import(name[level:], package, level)</p>
<p dir="auto">Msg 39019, Level 16, State 2, Line 7<br>
An external script error occurred:<br>
ImportError: No module named '_pywrap_tensorflow_internal'</p>
<p dir="auto">During handling of the above exception, another exception occurred:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "", line 5, in <br>
File "D:\MSSQL14.MSSQLSERVER\MSSQL\ExtensibilityData\MSSQLSERVER01\EA86FFCC-FD02-4E32-B3CB-E9AF5CE7CC5F\sqlindb.py", line 31, in transform<br>
import tensorflow as tf<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow_<em>init</em>_.py", line 24, in <br>
from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python_<em>init</em>_.py", line 49, in <br>
from tensorflow.python import pywrap_tensorflow<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <br>
raise ImportError(msg)<br>
ImportError: Traceback (most recent call last):</p>
<p dir="auto">Msg 39019, Level 16, State 2, Line 7<br>
An external script error occurred:<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_import_helper<br>
return importlib.import_module(mname)<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_<em>init</em>_.py", line 126, in import_module<br>
return _bootstrap._gcd_import(name[level:], package, level)<br>
File "", line 986, in _gcd_import<br>
File "", line 969, in _find_and_load<br>
File "", line 958, in _find_and_load_unlocked<br>
File "", line 666, in _load_unlocked<br>
File "", line 577, in module_from_spec<br>
File "", line 906, in create_module<br>
File "", line 222, in _call_with_frames_removed<br>
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.</p>
<p dir="auto">Msg 39019, Level 16, State 2, Line 7<br>
An external script error occurred:<br>
During handling of the above exception, another exception occurred:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <br>
from tensorflow.python.pywrap_tensorflow_internal import *<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in <br>
_pywrap_tensorflow_internal = swig_import_helper()<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_import_helper<br>
return importlib.import_module('<em>pywrap_tensorflow_internal')<br>
File "D:\MSSQL14.MSSQLSERVER\PYTHON_SERVICES\lib\importlib_<em>init</em></em>.py", line 126, in import_module<br>
return _bootstrap._gcd_import(name[level:], package, level)<br>
ImportError: No module named '_pywrap_tensorflow_internal'</p>
<p dir="auto">Msg 39019, Level 16, State 2, Line 7<br>
An external script error occurred:<br>
Failed to load the native TensorFlow runtime.</p>
<p dir="auto">See <a href="https://www.tensorflow.org/install/install_sources#common_installation_problems" rel="nofollow">https://www.tensorflow.org/install/install_sources#common_installation_problems</a></p>
<p dir="auto">for some common reasons and solutions.  Include the entire stack trace<br>
above this error message when asking for help.</p>
<p dir="auto">As announced in release notes, TensorFlow release binaries version 1.6 and higher are prebuilt with AVX instruction sets. This means on any CPU that do not have these instruction sets either CPU or GPU version of TF will fail to load with any of the following errors:</p>
<ul dir="auto">
<li><code class="notranslate">ImportError: DLL load failed:</code></li>
<li>A crash with return code 132</li>
</ul>
<p dir="auto">Our recommendation is to build TF from sources on these systems.</p>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: No</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: ubuntu/windows/macos</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: binary</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.6 and up</li>
<li><strong>Python version</strong>:  2.7, 3.3, 3.4, 3.5, 3.6 and any newer</li>
<li><strong>Bazel version (if compiling from source)</strong>: n/a</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: n/a</li>
<li><strong>CUDA/cuDNN version</strong>: any</li>
<li><strong>GPU model and memory</strong>: any</li>
<li><strong>Exact command to reproduce</strong>: python -c "import tensorflow as tf"</li>
</ul>