Distributing a psutil program with py2app

61 views
Skip to first unread message

Matt Dodge

unread,
Mar 14, 2012, 10:47:43 AM3/14/12
to psu...@googlegroups.com
I have a python program running on OSX 10.7 that uses psutil and works fine when I run like this: python myapp.py

However, when I try to distribute the app as a standalone version with py2app, I am getting an error saying "No module named _psutil_osx". py2app is loading in the psutil module fine but it doesn't seem to like the sub-module called _psutil_osx. I suspect this is because this module gets loaded from a C file when psutil is compiled with gcc.

Does anyone know of a way to create a standalone version of a psutil app for Mac so that the user wouldn't have to have GCC/Xcode installed to compile these libraries ahead of time?

Thanks in advance

Giampaolo Rodolà

unread,
Mar 14, 2012, 10:51:20 AM3/14/12
to psu...@googlegroups.com

I think you might have more luck by asking on py2app ml instead.

G.

Jay Loden

unread,
Mar 14, 2012, 10:55:00 AM3/14/12
to psu...@googlegroups.com
I would agree... I'm not familiar with py2app so I really can't provide much insight into why it wouldn't be including the necessary modules. You're correct in assuming _psutil_osx is a C module; a different module is compiled on each platform. It's possible the dynamic imports in psutil are confusing py2app, since we load the correct platform-specific module at import time. If you ask there the py2app gurus might be able to confirm or point you in the right direction. 

-Jay

Matt Dodge

unread,
Mar 14, 2012, 11:49:17 AM3/14/12
to psu...@googlegroups.com
Thanks, I will try that now and see what I can find there.
Reply all
Reply to author
Forward
0 new messages