Issues

Issue #45 resolved

psutil error: ImportError: No module named _psutil_osx

Arturo Filastò
created an issue

There are problems in building psutil on OSX 10.7. It appears to copy the dynlibs to the appropriate directory, but it then fails to import it.

This is the script I am trying to build: {{{ $ cat helloworld.py }}} {{{ import psutil print psutil.cpu_times() }}}

This is my setup.py: {{{ $ cat setup.py }}}

{{{ from distutils.core import setup import py2app

setup( app=["helloworld.py"], ) }}}

$ python setup.py py2app

$ ./dist/helloworld.app/Contents/MacOS/helloworld {{{ Traceback (most recent call last): File "/Users/y/Documents/code/building/osx/dist/helloworld.app/Contents/Resources/boot.py", line 50, in <module> _run('helloworld.py') File "/Users/y/Documents/code/building/osx/dist/helloworld.app/Contents/Resources/boot.py", line 47, in _run execfile(path, globals(), globals()) File "/Users/y/Documents/code/building/osx/dist/helloworld.app/Contents/Resources/helloworld.py", line 9, in <module> import psutil File "psutil/init.pyc", line 77, in <module> File "psutil/_psosx.pyc", line 14, in <module> ImportError: No module named _psutil_osx }}}

If I look inside of the lib-dynload directory I see it there though: {{{ $ ls dist/helloworld.app/Contents/Resources/lib/python2.7/lib-dynload/ _psutil_osx.so _psutil_posix.so

}}}

cc Michele Orrù

Comments (4)

  1. Log in to comment