Error running theano.test() - ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed
<p>I'm trying to get theano up and running on a Windows 10 (x64) machine.</p>

<p>I've installed Python from the WinPython distribution, which comes with theano already running. But after installing CUDA 8.0.44 and MingW, I constantly get the following errors when running the simple script</p>

<pre><code>import theano
theano.test()
</code></pre>

<p>Note that I had several warnings before, that I already solved (e.g. by installing missing packages from <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/" rel="nofollow noreferrer">here</a>. But this error gives me no usable information. The really weird thing is, that the module-name is not given anywhere that theano is missing.</p>

<pre><code>theano.gof.opt: ERROR: Optimization failure due to: constant_folding
theano.gof.opt: ERROR: node: DimShuffle{x,x}(TensorConstant{1.0})
theano.gof.opt: ERROR: TRACEBACK:
theano.gof.opt: ERROR: Traceback (most recent call last):
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\opt.py", line 1772, in process_node
    replacements = lopt.transform(node)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\tensor\opt.py", line 5825, in constant_folding
    no_recycling=[])
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\op.py", line 970, in make_thunk
    no_recycling)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\op.py", line 879, in make_c_thunk
    output_storage=node_output_storage)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\cc.py", line 1200, in make_thunk
    keep_lock=keep_lock)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\cc.py", line 1143, in __compile__
    keep_lock=keep_lock)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\cc.py", line 1595, in cthunk_factory
    key=key, lnk=self, keep_lock=keep_lock)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\cmodule.py", line 1142, in module_from_key
    module = lnk.compile_cmodule(location)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\cc.py", line 1506, in compile_cmodule
    preargs=preargs)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\cmodule.py", line 2213, in compile_str
    return dlimport(lib_filename)
  File "C:\Programmieren\WinPython-64bit-3.5.2.2\python-3.5.2.amd64\lib\site-packages\theano\gof\cmodule.py", line 299, in dlimport
    rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
</code></pre>

<p>Potentially related posts are <a href="https://stackoverflow.com/questions/24402213/theano-test-optimization-failure-due-to-constant-folding-on-ubuntu">Test Optimization failure</a> and <a href="https://stackoverflow.com/questions/34508431/installing-theano-on-windows-dll-load-failed">Installing theano on windows</a>.</p>

<p>Any ideas how to resolve this or find out what dll is missing?</p>