psutil did not work on windows10 x64 while complie into exe using py2exee

340 views
Skip to first unread message

Ashish Namdev

unread,
Jan 12, 2016, 9:31:26 AM1/12/16
to psutil
Hi ,

i am trying to build a exe using psutil to measure cpu_percent.

i have used psutil with python 2.7 , developed code on win7x64.

i am hitting with DLL Load error on windows10 where as same code works on win7

Traces :

TraceBack (most recent call last):

File "pcutil.py" , line 13 , in <module>
File "modules\cputil.pyc" , line 6 , in <module>
File "psutil\__init__.pyc" , line 113 , in <module>
File "psutil\_pswindows.pyc" , line 14 , in <module>
File "psutil\_psutil_windows.pyc" , line 12 , in <module>
File "psutil\_psutil_windows.pyc" , line 10 , in __load
ImportError : DLL load failed : The operating system cannot run %1.


i have compiled pcutil.py into exe using py2exe to run on different windows versions.

Can someone please help me to get it fixed .

copied code to pastebin :

cputil : https://pastebin.mozilla.org/8856451
pcutil : https://pastebin.mozilla.org/8856452


Thank you

BR,
Ashish Namdev

davin...@gmail.com

unread,
Nov 18, 2016, 8:16:43 PM11/18/16
to psutil
I have the same issue in windows 10 with 32 bits you solved it?

Giampaolo Rodola'

unread,
Nov 18, 2016, 8:20:09 PM11/18/16
to psu...@googlegroups.com
What is the problem exactly?
Do you manage to use "plain" psutil by using pip + wheels but you bump into that error if you generate an exe with py2exe?

--
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-unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Message has been deleted

davin...@gmail.com

unread,
Nov 18, 2016, 8:31:27 PM11/18/16
to psutil
Yeah i built with py2exe. When i run the file show me the same error than him.

Traceback (most recent call last):
  File "laZagne.pyw", line 17, in <module>
  File "psutil\__init__.pyc", line 126, in <module>
  File "psutil\_pswindows.pyc", line 15, in <module>
  File "psutil\_psutil_windows.pyc", line 12, in <module>
  File "psutil\_psutil_windows.pyc", line 10, in __load
ImportError: DLL load failed: El sistema operativo no puede ejecutar %1.

This happen only in windows 10 in my windows 7 works fine.

I show you my setup.pyw file maybe it's for this , i think not.
from distutils.core import setup
import py2exe

setup(console=['console.pyw'])

The problem is that when i run the file, psutils show me error in windows 10 but in windows 7. I converted my pyw to .exe with py2exe.
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/d/optout.

davin...@gmail.com

unread,
Nov 18, 2016, 8:36:08 PM11/18/16
to psutil
i installed with installer psutil-5.0.0.win32-py2.7.exe (md5)
anyways show this error only in windows 10 in windows 7 works fine. 

Giampaolo Rodola'

unread,
Nov 18, 2016, 9:49:53 PM11/18/16
to psu...@googlegroups.com
I am afraid I don't have the necessary expertise to debug this problem or understand why it happens.
As far as I know this may be as well be an issue with py2exe.


--
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-unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

davin...@gmail.com

unread,
Nov 18, 2016, 11:52:31 PM11/18/16
to psutil
so py2exe compiled the version only working for windows 7 and not windows 10. i will try to install
Microsoft Visual C++ Compiler for Python 2.7
But i'm not sure the problem is of py2exe. but i take you the result

On Saturday, 19 November 2016 02:49:53 UTC, Giampaolo Rodola' wrote:
I am afraid I don't have the necessary expertise to debug this problem or understand why it happens.
As far as I know this may be as well be an issue with py2exe.

On Sat, Nov 19, 2016 at 2:36 AM, <davin...@gmail.com> wrote:
i installed with installer psutil-5.0.0.win32-py2.7.exe (md5)
anyways show this error only in windows 10 in windows 7 works fine. 

--
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/d/optout.

naimat...@gmail.com

unread,
Nov 19, 2016, 12:05:04 AM11/19/16
to psutil
when i compile with py2exe show me this:

The following modules appear to be missing:
['Carbon', 'Carbon.Files', 'Crypto.PublicKey._fastmath', 'ElementC14N', 'POW', '
_psutil_linux', 'enum', 'ordereddict', 'ordereddict.ordereddict', 'psutil._psuti
l_bsd', 'psutil._psutil_osx', 'psutil._psutil_posix', 'psutil._psutil_sunos']

So the problem is py2exe but one question how i can include and solve this¿? i installed psutil etc. and the other i dont know why. maybe i need to install more dependencies?



On Saturday, 19 November 2016 03:49:53 UTC+1, Giampaolo Rodola' wrote:
I am afraid I don't have the necessary expertise to debug this problem or understand why it happens.
As far as I know this may be as well be an issue with py2exe.

On Sat, Nov 19, 2016 at 2:36 AM, <davin...@gmail.com> wrote:
i installed with installer psutil-5.0.0.win32-py2.7.exe (md5)
anyways show this error only in windows 10 in windows 7 works fine. 

--
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/d/optout.

davin...@gmail.com

unread,
Nov 19, 2016, 1:30:35 PM11/19/16
to psutil
I'm sure now py2exe is not the problem psutils dont work with windows 10. I checked and it's not possible work in windows 7 my compiled program and in windows10 show me this error And missing libraries because i'm using other platform so this is not relevant. The problem is the module psutils dont work with windows 10 i alert you this is a bug.


On Saturday, 19 November 2016 03:49:53 UTC+1, Giampaolo Rodola' wrote:
I am afraid I don't have the necessary expertise to debug this problem or understand why it happens.
As far as I know this may be as well be an issue with py2exe.

On Sat, Nov 19, 2016 at 2:36 AM, <davin...@gmail.com> wrote:
i installed with installer psutil-5.0.0.win32-py2.7.exe (md5)
anyways show this error only in windows 10 in windows 7 works fine. 

--
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/d/optout.

Giampaolo Rodola'

unread,
Nov 19, 2016, 2:25:42 PM11/19/16
to psu...@googlegroups.com
On Sat, Nov 19, 2016 at 6:05 AM, <naimat...@gmail.com> wrote:
when i compile with py2exe show me this:

The following modules appear to be missing:
['Carbon', 'Carbon.Files', 'Crypto.PublicKey._fastmath', 'ElementC14N', 'POW', '
_psutil_linux', 'enum', 'ordereddict', 'ordereddict.ordereddict', 'psutil._psuti
l_bsd', 'psutil._psutil_osx', 'psutil._psutil_posix', 'psutil._psutil_sunos']

So the problem is py2exe but one question how i can include and solve this¿? i installed psutil etc. and the other i dont know why. maybe i need to install more dependencies?


The modules I see there (how did you get that list?) should NOT be part of the Windows installation (see the names) so the problem must be elsewhere.

Giampaolo Rodola'

unread,
Nov 19, 2016, 2:42:29 PM11/19/16
to psu...@googlegroups.com
On Sat, Nov 19, 2016 at 7:30 PM, <davin...@gmail.com> wrote:
I'm sure now py2exe is not the problem psutils dont work with windows 10. I checked and it's not possible work in windows 7 my compiled program and in windows10 show me this error And missing libraries because i'm using other platform so this is not relevant. The problem is the module psutils dont work with windows 10 i alert you this is a bug.
 
What do you mean by "psutil does not work on Win 10"?
Again: do you have this problem only after packaging your program with py2exe?
What happens if you install psutil (via the exe file on PYPI), then open the interpreter and "import psutil"?
Does it work? If not please re-paste the error if different than the one in your first message.

davin...@gmail.com

unread,
Nov 19, 2016, 5:43:48 PM11/19/16
to psutil
sorry sir you are right i was wrong again sorry a lot worked with pyinstaller Sorry really!
Reply all
Reply to author
Forward
0 new messages