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

842 views
Skip to first unread message

Rob De Vogelaere

unread,
Jun 29, 2016, 8:51:11 AM6/29/16
to CasADi
Hi all,

I am having troubles to load the casadi module.

I am using Anaconda  4.0.0 (64bit), python 3.4.4 on windows 7
casadi-py34-np1.9.1-v3.0.1-64bit

The module is located in "C:\Users\DEVOGELR\AppData\Local\Continuum\Anaconda3\Lib\site-packages\casadi"

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-19-7f19b2521074> in <module>()
      1 ypred = clf.predict(Xtest)
      2 ypred
----> 3 from casadi import *

C:\Users\DEVOGELR\AppData\Local\Continuum\Anaconda3\lib\site-packages\casadi\__init__.py in <module>()
     30 import sys
     31 if sys.version_info >= (3, 0):
---> 32   from casadi.casadi import *
     33 else:
     34   from casadi import *

C:\Users\DEVOGELR\AppData\Local\Continuum\Anaconda3\lib\site-packages\casadi\casadi.py in <module>()
     26                 fp.close()
     27             return _mod
---> 28     _casadi = swig_import_helper()
     29     del swig_import_helper
     30 else:

C:\Users\DEVOGELR\AppData\Local\Continuum\Anaconda3\lib\site-packages\casadi\casadi.py in swig_import_helper()
     22         if fp is not None:
     23             try:
---> 24                 _mod = imp.load_module('_casadi.pyc', fp, pathname, description)
     25             finally:
     26                 fp.close()

C:\Users\DEVOGELR\AppData\Local\Continuum\Anaconda3\lib\imp.py in load_module(name, file, filename, details)
    240                 return load_dynamic(name, filename, opened_file)
    241         else:
--> 242             return load_dynamic(name, filename, file)
    243     elif type_ == PKG_DIRECTORY:
    244         return load_package(name, filename)

C:\Users\DEVOGELR\AppData\Local\Continuum\Anaconda3\lib\imp.py in load_dynamic(name, path, file)
    340         spec = importlib.machinery.ModuleSpec(
    341             name=name, loader=loader, origin=path)                      
--> 342         return _load(spec)
    343
    344 else:

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

When I print the filename etc in casadi.py
from sys import version_info
if version_info >= (2,6,0):
   
def swig_import_helper():
       
from os.path import dirname
       
import imp
        fp
= None
       
try:
            fp
, pathname, description = imp.find_module('_casadi', [dirname(__file__)])
       
except ImportError:
           
import _casadi
           
return _casadi  
       
if fp is not None:
           
print (fp)
           
print (pathname)
           
print (description)

I get the following items.
<_io.BufferedReader name='C:\\Users\\DEVOGELR\\AppData\\Local\\Continuum\\Anaconda3\\lib\\site-packages\\casadi\\_casadi.pyd'>
C:\Users\DEVOGELR\AppData\Local\Continuum\Anaconda3\lib\site-packages\casadi\_casadi.pyd
('.pyd', 'rb', 3)


_casadi.pyd exists.

Joris Gillis

unread,
Jun 30, 2016, 1:53:23 AM6/30/16
to CasADi
Hi Rob,

You must be the first Py3.* CasADi user out there, that we know of.
I'll try to reproduce it on my machine.

Things to try out while I find time to do this:
 * try winpython
 * run http://www.dependencywalker.com/ on _casadi.pyd

Best regards,
  Joris

Rob De Vogelaere

unread,
Jul 4, 2016, 6:44:54 AM7/4/16
to CasADi

Hi Joris,


I used the depencency walker.
I use a 64bit windows and 64bit Anaconda instalation. I believe the problem lays therein.

The following modules are part of KERNEL32.dll and were not found.

API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
DCOMP.DLL
GPSVC.DLL
IESHIMS.DLL


Then there are about 210 modules that are 32bit instead of 64.


I am very new to Python and only wanted to try out some things. So if casadi with python 3 is farily new, then I will use python 2.

Best regards,

Rob


Op woensdag 29 juni 2016 14:51:11 UTC+2 schreef Rob De Vogelaere:
Reply all
Reply to author
Forward
0 new messages