Skip to content

DLL load error with ctypes if files are not in the same folder #18

Description

@aashok3

I was getting this error message when I tried to run 'import fncs' even with the location of the libfncs and other DLLs added to the PYTHONPATH env variable.

Traceback (most recent call last):
File "<pyshell#0>", line 1, in
import fncs
File "c:\users\battelle (pnnl)\desktop\aditya\fncs\fncs\python\fncs.py", line 11, in
_lib = ctypes.CDLL(libname)
File "C:\Python27\lib\ctypes_init
.py", line 362, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

@jeffdaily mentioned that this was due to the assumption that the ctypes call made in fncs.py assumed files to be in the same folder. The libname passed does not involve the full path.

Activity

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