qd-cae/qd-cae-python

Cannot import qd.cae.dyna.KeyFile on Windows 10

AlexanderNenninger opened this issue · 3 comments

Hello again,

After installing qd via pip on windows 10 in a clean conda environment, I get the following error:

Python 3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from qd.cae.dyna import KeyFile
Traceback (most recent call last):
  File "C:\Users\NENNIA\AppData\Local\Continuum\miniconda3\envs\cae_viz\lib\site-packages\qd\cae\dyna.py", line 4, in <module>
    from .dyna_cpp import *
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\NENNIA\AppData\Local\Continuum\miniconda3\envs\cae_viz\lib\site-packages\qd\cae\dyna.py", line 7, in <module>
    "Could not import C++ Submodule dyna_cpp with error message: %s." % str(err))
ImportError: Could not import C++ Submodule dyna_cpp with error message: DLL load failed: Das angegebene Modul wurde nicht gefunden..

This is a typical windows dll hell error, which has been haunting me for a while. Some windows dll's required by the library (they were compiled against them) are not present on your machine. Usually software installs it for you in the background. I must have admit I haven't found a stable way to ensure this yet.

Try the Visual Studio 2015, 2017 and 2019 Redistributionals, this usually fixes it.

I tried to find a "maintainable" way of ensuring the machine is set up right but such dependecy issues haunted me every since, which lead me to revert to python only in lasso-python, which unfortunately though does not have the KeyFile class though.

For anyone googleing this; Compilation works though:

  1. Download https://visualstudio.microsoft.com/de/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
  2. Install Visual Studio Build Tools
  3. Clone this git
  4. python setup.py install

I checked it on a clean machine and found two missing DLLs needed from femzip:

  • LIBIOMP5MD.DLL
  • LIBMMD.DLL

these can be installed in anaconda by

conda install mkl
conda install icc_rt

This should fix the issue and you can decompress femzipped files.