title: sklearn OMP: Error #15 ("Initializing libiomp5md.dll, but found mk2iomp5md.dll already initialized.") when fitting models
body: <p>I have recently uninstalled a nicely working copy of Enthought Canopy 32-bit and installed Canopy version 1.1.0 (64 bit). When I try to use <a href="http://en.wikipedia.org/wiki/Scikit-learn" rel="noreferrer">sklearn</a> to fit a model my kernel crashes, and I get the following error:</p>
  <blockquote>
  <p>The kernel (user Python environment) has terminated with error code 3. This may be due to a bug in your code or in the kernel itself.</p>
  <p>Output captured from the kernel process is shown below.</p>
  <p>OMP: Error #15: Initializing libiomp5md.dll, but found mk2iomp5md.dll already initialized.</p>
  <p>OMP: Hint: This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable <code>KMP_DUPLICATE_LIB_OK=TRUE</code> to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see <a href="http://www.intel.com/software/products/support/" rel="noreferrer">http://www.intel.com/software/products/support/</a>.</p>
  </blockquote>
  <p>The same code was running just fine under Canopy's 32 bit. The code is really just a simple fit of a</p>
  <pre><code>linear_model.SGDClassifier(loss='log')
  </code></pre>
  <p>(same error for Logistic Regression, haven't tried other models)</p>
  <p>How do I fix this?</p>