DLL load failed on win7 64

744 views
Skip to first unread message

concussionGFX

unread,
Nov 19, 2011, 11:18:39 AM11/19/11
to psutil
Hi all,

I have an app that is built on winxp-32 and packaged with pyinstaller.
Everything works fine on xp/vista/7 32 but when I run on win7-64 I get
the following error.

ImportError: DLL load failed: A dynamic link library (DLL)
initialization routine failed.

it is failing on "import _psutil_mswindows"

Is it possible to run the 32 bit version on a 64 bit system or is this
a pyinstaller issue?

Thanks!
-Tim

Giampaolo Rodolà

unread,
Nov 19, 2011, 11:27:49 AM11/19/11
to psu...@googlegroups.com
2011/11/19 concussionGFX <t...@concussion.cc>:
> --
> You received this message because you are subscribed to the "Python process utilities (psutil)" project group:
> http://code.google.com/p/psutil
> To post to this group, send email to psu...@googlegroups.com
> To unsubscribe from this group, send email to psutil-un...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/psutil

I don't know about pyinstaller but usually if you compile a python
lib/app for 32 bit systems that's not gonna work on 64 bits and vice
versa.
Indeed we provide 2 psutil installers for windows: one for 32 bits and
another one for 64 bit systems.
Not that all this is referred to the *python* version.
For example: you might install python 2.7 32-bit on a 64 bit system.
In that case you'll have to use psutil 32 bit version: the 64-bit
version won't work.

In summary: I'm not sure what you're doing exactly but if you want to
distribute your program as a Windows executable/installer, as we're
doing for psutil, you'll need to provide both 32 and 64 versions.

Hope this helps.

Concussion GFX - Tim

unread,
Nov 19, 2011, 12:59:00 PM11/19/11
to psu...@googlegroups.com
Thanks for the info Giampaolo, but I disagree with part of it. A 32 bit
app should work on a 64 system just not the other way.
I need to keep the app at 32 and packaging this with pyinstaller should
be the same as installing a 32 bit python version on a 64 bit system
(just like you mentioned at the end). It is just using the 32bit
interpreter.

I think my issue might be that psutil is looking in C:\Windows\SysWOW64
for the DLL dependencies and not C:\WINDOWS\system32
it seems that 2 of it dependencies exist in both:

psapi.dll
iphlpapi.dll

I am not sure how to check this or override it. any ideas?

Thanks again!
-Tim

Giampaolo Rodolà

unread,
Nov 19, 2011, 1:38:51 PM11/19/11
to psu...@googlegroups.com
2011/11/19 Concussion GFX - Tim <t...@concussion.cc>:

> Thanks for the info Giampaolo, but I disagree with part of it. A 32 bit app
> should work on a 64 system just not the other way.
> I need to keep the app at 32 and packaging this with pyinstaller should be
> the same as installing a 32 bit python version on a 64 bit system (just like
> you mentioned at the end). It is just using the 32bit interpreter.

You're right sorry, I misinterpreted your problem.

> I think my issue might be that psutil is looking in C:\Windows\SysWOW64 for
> the DLL dependencies and not C:\WINDOWS\system32
> it seems that 2 of it dependencies exist in both:
>
> psapi.dll
> iphlpapi.dll
>
> I am not sure how to check this or override it. any ideas?

I think you incurred into this:
http://code.google.com/p/psutil/issues/detail?id=191
I have no solution though, sorry.
It seems quite some people are affected by this:
http://www.google.it/search?gcx=w&sourceid=chrome&ie=UTF-8&q=python+ImportError%3A+DLL+load+failed%3A+A+dynamic+link+library+(DLL)

Reply all
Reply to author
Forward
0 new messages