Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71457

Re: ctypes does not load .dll and generate windowsError 127

References <46e1b559ed224fbfbc1c786739ce68c8@DBXPR04MB319.eurprd04.prod.outlook.com>
Date 2014-05-13 19:35 +1000
Subject Re: ctypes does not load .dll and generate windowsError 127
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.9955.1399973703.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, May 13, 2014 at 6:45 PM, Ji Xia <ji.xia@nxp.com> wrote:
> Could anybody help me out? I am trying to use python ctypes and load a .dll
> file. It works on my colleagues’ machine, just does not work on mine
>
> Python on my machine is : python 2.7.6
>
> OS: windows 7
>
> Result is always:
>
>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>
>     self._handle = _dlopen(self._name, mode)
>
> WindowsError: [Error 127] The specified procedure could not be found
>
>

It would help to know what DLL you're loading. Are you copying the
exact same DLL file from one computer to the other, or referencing
something that's already there?

It may be that the DLL you name is statically linked to another DLL,
and it's the second one that's causing problems. In that case, even
copying the file across won't solve the problem. Look for a DLL
dependency tree program (you can find them at the other end of a web
search) and see if you have versioning issues.

This isn't actually a Python problem, it's all to do with the loading
of that DLL.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: ctypes does not load .dll and generate windowsError 127 Chris Angelico <rosuav@gmail.com> - 2014-05-13 19:35 +1000

csiph-web