Skip to content

DLL load failed: The specified module could not be found. #46

Closed

Description

@abhilashknair

Hi,
I have successfully installed the slycot package using a wheel file. I am try to import slycot in Python. I get the following error log. Could someone please help me understand the issue here? Thanks! :)

import slycot
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\slycot_init_.py", line 18, in
from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd,
File "C:\Python27\lib\site-packages\slycot\analysis.py", line 21, in
from . import _wrapper
ImportError: DLL load failed: The specified module could not be found.

Activity

  1. repagh commented on Feb 1, 2019

    @repagh
    Member

    Did you create this wheel file or get it from somewhere?
    What version of slycot?
    Note that slycot for windows is pretty difficult to compile, you might want to use the anaconda version, and pull a compiled package from my conda channel (repa).

    p.s. why are you still using Python 2.7?

  2. T-BA commented on Apr 1, 2019

    @T-BA

    Hi, I also have an issue with the DLL, on windows 10, tried with both python 3.5.6 and 3.6.3 (our default version).

    My steps with a clean conda environment:

    conda create -n py35 python=3.5 numpy
    conda config --append channels conda-forge
    conda install -c repa slycot
    conda install control
    

    When I attempt to run the following minimal example:

    from control import *
    num = [[[1., 2.], [3., 4.]], [[5., 6.], [7., 8.]]]
    den = [[[9., 8., 7.], [6., 5., 4.]], [[3., 2., 1.], [-1., -2., -3.]]]
    sys1 = tf(num, den)
    tf2ss(sys1)
    

    I get the error:

    example.py
    Traceback (most recent call last):
    File "<tmp 1>", line 9, in
    tf2ss(sys1)
    File "C:\Python\Conda\envs\py35\lib\site-packages\control\statesp.py", line 1245, in tf2ss
    return _convertToStateSpace(sys)
    File "C:\Python\Conda\envs\py35\lib\site-packages\control\statesp.py", line 830, in _convertToStateSpace
    raise TypeError("No support for MIMO without slycot")
    TypeError: No support for MIMO without slycot

    When I attempt to import slycot, I get:

    import slycot
    Traceback (most recent call last):
    File "", line 1, in
    File "C:\Python\Conda\envs\py35\lib\site-packages\slycot_init_.py", line 16, in
    from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd,
    File "C:\Python\Conda\envs\py35\lib\site-packages\slycot\analysis.py", line 21, in
    from . import _wrapper
    ImportError: DLL load failed: The specified module could not be found.

    Do you have any sugestions? If you need any additional info please let me know.

  3. WRadigan commented on Apr 16, 2019

    @WRadigan

    Similar issue here. I tried installing the Python 3.5 / Win64 Wheel from the link below into my Enthought Canopy environment (Canopy v2.1.9). Pip ran without error, but import failed afterwards.

    Also, what's the difference between Enthought Canopy and the Anaconda Python Distribution? I'm a mid-level user (at best) and I'm happy to try something new if my toolset is just a bit old.

    https://www.lfd.uci.edu/~gohlke/pythonlibs/

  4. bnavigator commented on Jun 21, 2019

    @bnavigator
    Collaborator

    I looked into the wheel packages from that last link. I am not sure, but it seems that the compiled library wrapper in there has the wrong name. Go to your site-packages\slycot directory and copy the file named _wrapper.cp36-win-amd64.pyd to _wrapper.pyd

    Or switch to Anaconda.

  5. tstorek commented on Aug 8, 2019

    @tstorek

    Hi,
    i have the same issue. I use anaconda3. I already tried to set up a fresh environment with python3.7 .
    I copied the _wrapper.cp37-win-amd64.pyd to _wrapper.pyd. But same result.
    Before that I tried to use the conda package from conda-forge.

    But still, slycot cannot find that stupid DLL.

    I am a bit frustrated already. Since I am realy interested in the MIMO stuff I would like to test it.

    Thanks for any help.

  6. bnavigator commented on Aug 8, 2019

    @bnavigator
    Collaborator

    What's the version of your slycot package from conda-forge?

    The most recent file for win64 slycot-0.3.5.0 for py37 does not have a _wrapper.cp37-win-amd64.pyd but a correctly named _wrapper.pyd and _wrapper.lib file in site-packages/slycot
    https://anaconda.org/conda-forge/slycot/files

  7. tstorek commented on Aug 8, 2019

    @tstorek

    Hi,
    it worked now. But seriously don't have the slightest clue why :D
    What I did:

    • Setting up fresh environment
    • Added conda-forge and menpo to my channels
    • installing numpy and all other packages from conda
    • Then installed slycot again with conda (latest)(slycot-0.3.5.0-py3.7-win-amd64)

    And surprisingly it works now. But I as I said, no idea why. Maybe it is the order in that I installed the packages, but I thought that conda would check that for me. Maybe it is because I used menpo for openblas installation.

    -----EDIT------
    Other Error occurred. Only later in my program. <---incorrect solution

  8. bnavigator commented on Aug 8, 2019

    @bnavigator
    Collaborator

    Order is not important, conda should check all the necessary dependencies. Just install slycot and control in a fresh environment and numpy etc gets pulled in automatically.

    Just don't mix different conda channels and manually downloaded wheels if you don't know exactly what you are doing.

  9. tstorek commented on Aug 8, 2019

    @tstorek

    Okay, thanks for the info. Now a version error occurred. Hence, still not working. So you might be right I will try again.

    --EDIT--
    I tried to reinstall everything again only using conda-forge and then finally the SIPPY package for system identification, which is not available on conda-forge.
    The Slycot examples seam to work individually now. Although the process does not exist. So I have to to exit them manually using "exit()"

    Connected to pydev debugger (build 191.8026.44)
    import sys; print('Python %s on %s' % (sys.version, sys.platform))
    Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] on win32

    I am not sure if this is still directly linked to slycot. Otherwise I will try to find a solution some other place. Thank you anyway

  10. bnavigator commented on May 30, 2020

    @bnavigator
    Collaborator

    Closing with version 0.4.0 having been released. Feel free to re-open, if you believe the issue is not resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions