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

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'causing': 0.04; 'tree': 0.05; 'statically': 0.07; '__init__': 0.09; 'dependency': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'windows': 0.15; 'dll,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'os:': 0.16; 'other,': 0.16; 'referencing': 0.16; 'subject:ctypes': 0.16; 'there?': 0.16; '(you': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'machine': 0.22; 'cc:addr:python.org': 0.22; 'load': 0.23; 'dll': 0.24; 'subject: .': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'skip:" 30': 0.26; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'specified': 0.30; 'message-id:@mail.gmail.com': 0.30; '13,': 0.31; 'ctypes': 0.31; 'loading': 0.31; 'file': 0.32; 'another': 0.32; 'copying': 0.34; 'skip:_ 10': 0.34; 'could': 0.34; 'problem.': 0.35; 'something': 0.35; 'anybody': 0.35; 'case,': 0.35; 'received:google.com': 0.35; 'mine': 0.38; 'pm,': 0.38; 'does': 0.39; 'even': 0.60; 'problems.': 0.60; 'solve': 0.60; "you're": 0.61; 'name': 0.63; 'linked': 0.65; '[error': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=5WpE+MrFR1qu6EbeNVaiOLqRFauno66vOxtj5R4oexQ=; b=UYEnXLQa0pApgdJwfT18Es/cr9DaZSJPbWgOOws3avXpvNSNE/IPwHQ11fjvawMYmr icRFZZcJTQDbuW3NKRnvQvInPeIz6jC7OQOwfowH778IIT86Z+62KGJS4nO1L5swLLsT JL1DSY0mI8PgBg42XPKXpS2cxQECxqg7egM278qYMvGK3SyLzvd1iOzqNwexAsk6zILI 2sCkDsQ5fYZW86WUoaye5PxLnqeA49+d1tegAijnlYQ8tU8O8stVWmGZVDvGzXzKR1e9 NPQdTdIGbJweJLQGK76ea19z3t3FaWVycx1N/eJQo/mHtJlvq/BSsG3gZ+HcyKziXmrL C8FA==
MIME-Version 1.0
X-Received by 10.58.126.135 with SMTP id my7mr6965545veb.27.1399973700141; Tue, 13 May 2014 02:35:00 -0700 (PDT)
In-Reply-To <46e1b559ed224fbfbc1c786739ce68c8@DBXPR04MB319.eurprd04.prod.outlook.com>
References <46e1b559ed224fbfbc1c786739ce68c8@DBXPR04MB319.eurprd04.prod.outlook.com>
Date Tue, 13 May 2014 19:35:00 +1000
Subject Re: ctypes does not load .dll and generate windowsError 127
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9955.1399973703.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1399973703 news.xs4all.nl 2937 [2001:888:2000:d::a6]:40793
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71457

Show key headers only | 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