zhengzheng / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Doesn't works with PyPy 1.7 / Mac OS X 10.6.8 #239

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Install psutil
2. import psutil

  File "/Users/aleksi/Code/x/y.py", line 8, in <module>
    import psutil
  File "/Users/aleksi/Code/x/env_pypy/site-packages/psutil/__init__.py", line 77, in <module>
    import psutil._psosx as _psplatform
  File "/Users/aleksi/Code/x/env_pypy/site-packages/psutil/_psosx.py", line 14, in <module>
    import _psutil_osx
exceptions.ImportError: unable to load extension module 
'/Users/aleksi/Code/x/env_pypy/site-packages/_psutil_osx.pypy-17.so': 
dlopen(/Users/aleksi/Code/x/env_pypy/site-packages/_psutil_osx.pypy-17.so, 6): 
Symbol not found: _PyExc_OSError
  Referenced from: /Users/aleksi/Code/x/env_pypy/site-packages/_psutil_osx.pypy-17.so
  Expected in: flat namespace
 in /Users/aleksi/Code/x/env_pypy/site-packages/_psutil_osx.pypy-17.so

PyPy 1.7.0, 64bit, built with GCC 4.0.1
Mac OS X 10.6.8, 32bit kernel loaded
_psutil_osx.pypy-17.so - 64bit.

Original issue reported on code.google.com by alexey.p...@qik.com on 21 Dec 2011 at 3:13

GoogleCodeExporter commented 9 years ago
psutil version 0.4.1.

Original comment by alexey.p...@qik.com on 21 Dec 2011 at 3:15

GoogleCodeExporter commented 9 years ago
> Symbol not found: _PyExc_OSError

I saw similar errors on systems where python headers weren't installed (e.g. on 
ubuntu you get them with "sudo apt-get install python-dev").
Are you able to compile with cPython?
Have you tried to delete "build" directory before installing?
That often causes troubles when the source is compiled/installed for different 
python versions.

Original comment by g.rodola on 21 Dec 2011 at 5:36

GoogleCodeExporter commented 9 years ago
> I saw similar errors on systems where python headers weren't installed (e.g. 
on ubuntu you get them with "sudo apt-get install python-dev").

I use PyPy from official site, headers are in place. Also, it should prevent 
compiling, not importing, right?

> Are you able to compile with cPython?

Yes, it works great with CPython 2.7.2.

> Have you tried to delete "build" directory before installing?

In fact I use virtualenv, so I doesn't have build directory.

I noticed something strange:

otool -L /Users/aleksi/Code/x/env_pypy/site-packages/_psutil_osx.pypy-17.so
/Users/aleksi/Code/x/env_pypy/site-packages/_psutil_osx.pypy-17.so:
    build/lib.macosx-10.6-x86_64-2.7/_psutil_osx.pypy-17.so (compatibility version 0.0.0, current version 0.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.44.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

It depends on file in build directory, which is removed during pip's clean up 
step.

Original comment by alexey.p...@qik.com on 22 Dec 2011 at 7:41

GoogleCodeExporter commented 9 years ago
Try not to use virtualenv and make sure 'pypy -c "import psutil"' raises 
ImportError, then try to reinstall.

Original comment by g.rodola on 22 Dec 2011 at 5:26

GoogleCodeExporter commented 9 years ago
Same error.

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/Cellar/pypy/1.7/site-packages/psutil/__init__.py", line 77, in <module>
    import psutil._psosx as _psplatform
  File "/usr/local/Cellar/pypy/1.7/site-packages/psutil/_psosx.py", line 14, in <module>
    import _psutil_osx
ImportError: unable to load extension module 
'/usr/local/Cellar/pypy/1.7/site-packages/_psutil_osx.pypy-17.so': 
dlopen(/usr/local/Cellar/pypy/1.7/site-packages/_psutil_osx.pypy-17.so, 6): 
Symbol not found: _PyExc_OSError
  Referenced from: /usr/local/Cellar/pypy/1.7/site-packages/_psutil_osx.pypy-17.so
  Expected in: flat namespace
 in /usr/local/Cellar/pypy/1.7/site-packages/_psutil_osx.pypy-17.so

Original comment by alexey.p...@qik.com on 23 Dec 2011 at 1:36

GoogleCodeExporter commented 9 years ago
I have no clue, sorry. FWICT, it works on linux + pypy 1.7.
It looks like something related with the system configuration (missing 
headers?) so maybe you can try to ask on pypy ml.

Original comment by g.rodola on 23 Dec 2011 at 1:50

GoogleCodeExporter commented 9 years ago
Closing this out.

Original comment by g.rodola on 6 Mar 2012 at 12:37

GoogleCodeExporter commented 9 years ago
It's valid, in fact. But I did not find a solution.

Original comment by alexey.p...@gmail.com on 6 Mar 2012 at 12:43

GoogleCodeExporter commented 9 years ago
Have you tried to ask on pypy forums?

Original comment by g.rodola on 6 Mar 2012 at 12:49

GoogleCodeExporter commented 9 years ago
In IRC only, without luck.
We use Mac for development only, so we did a stub for tests.

Original comment by alexey.p...@gmail.com on 6 Mar 2012 at 12:53