Re: [psutil] one user has trouble importing _psutil_mswindows in py2exe app

764 views
Skip to first unread message

Giampaolo Rodola'

unread,
Apr 26, 2013, 5:28:12 AM4/26/13
to psu...@googlegroups.com
It seems you bumped into:
https://code.google.com/p/psutil/issues/detail?id=348
Problem with that issue is that I cannot reproduce it.
Maybe you can help with that?

You can:
1) try to apply the patch I attached in comment #10:
https://code.google.com/p/psutil/issues/detail?id=348#c10

2) try what eryksun is suggesting in comment #13:
https://code.google.com/p/psutil/issues/detail?id=348#c13

2013/4/25 <makdad...@gmail.com>:
> I have an app built with py2exe. My main server.py file imports psutil. This
> in turn imports psutil._psmswindows. This in turn imports _psutil_mswindows.
> This latter file, _psutil_mswindows, apparently cannot be found, but this
> problem only happens on one specific user machine; several other users have
> no trouble. Here is the output for the user who had trouble:
>
>
> C:\myapplication\dist>server.exe
>
> Traceback (most recent call last):
>
> File "server.py", line 154, in <module>
>
> File "psutil\__init__.pyc", line 76, in <module>
>
> File "psutil\_psmswindows.pyc", line 16, in <module>
>
> ImportError: DLL load failed: The specified procedure could not be found.
>
>
> When I look in the dist folder built by py2exe, there is a dist/library
> subfolder, and a dist/library/psutil subfolder within that.
> dist/library/psutil contains _psmswindows.pyc. As for _psutil_mswindows.pyc,
> I actually see both _psutil_mswindows.pyc and _psutil_mswindows.pyd in the
> dist/library/ folder (not in the psutil subfolder). This parallels what I
> have in my C:\Python26\Lib\site-packages folder, which contains
> _psutil_mswindows.pyd on the top level and also a psutil subfolder.
> Anyway, the main question is: How could this problem be happening for only
> one user?
>
> Thanks for any help.
>
>
> --
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "psutil" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to psutil+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

makdad...@gmail.com

unread,
Apr 26, 2013, 3:52:00 PM4/26/13
to psu...@googlegroups.com
Thanks very much for the reply. Sorry I wasn't able to find that previous issue page before creating a new discussion. I will comment on my experience on that page (https://code.google.com/p/psutil/issues/detail?id=348).

makdad...@gmail.com

unread,
Apr 29, 2013, 3:03:01 PM4/29/13
to psu...@googlegroups.com
We were able to fix this for the one user who was seeing it by copying the two files
 
_psutil_mswindows.pyc
_psutil_mswindows.pyd
 
into dist/library/psutil.

Giampaolo Rodola'

unread,
May 2, 2013, 10:57:11 AM5/2/13
to psu...@googlegroups.com

On Monday, April 29, 2013 9:03:01 PM UTC+2, makdad...@gmail.com wrote:
We were able to fix this for the one user who was seeing it by copying the two files
 
_psutil_mswindows.pyc
_psutil_mswindows.pyd
 
into dist/library/psutil.

That's not the best solution though.
I was hoping you could try the patch above, compile psutil, and tell us if that fixes the issue. 

Kiran James

unread,
Sep 3, 2013, 12:41:13 PM9/3/13
to psu...@googlegroups.com

I am having the same issues with my XP machine.. Is there a fix for this?

Giampaolo Rodola'

unread,
Sep 3, 2013, 12:59:51 PM9/3/13
to psu...@googlegroups.com
Have you tried the solutions above?
I mean these:

<<
You can:
1) try to apply the patch I attached in comment #10:
https://code.google.com/p/psutil/issues/detail?id=348#c10

2) try what eryksun is suggesting in comment #13:
https://code.google.com/p/psutil/issues/detail?id=348#c13
>>

--
Reply all
Reply to author
Forward
0 new messages