SiggiGue / pyfilterbank

Implementing a fractional octave filterbank for python. Based on Numpy and CFFI.
107 stars 27 forks source link

error in test pyoct #4

Closed bfrax closed 7 years ago

bfrax commented 8 years ago

Dear all,

I would like to use this library for sound analysis in python but i have an error: command: python test_octbank.py

Traceback (most recent call last): File "test_octbank.py", line 3, in <module> import pyfilterbank.octbank as fb File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyfilterbank-0.0.0-py2.7.egg/pyfilterbank/__init__.py", line 11, in <module> from . import butterworth File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyfilterbank-0.0.0-py2.7.egg/pyfilterbank/butterworth.py", line 9, in <module> from pyfilterbank.sosfiltering import bilinear_sos File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyfilterbank-0.0.0-py2.7.egg/pyfilterbank/sosfiltering.py", line 74, in <module> _c = ffi.dlopen(_mylibpath) File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 139, in dlopen lib, function_cache = _make_ffi_library(self, name, flags) File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 742, in _make_ffi_library backendlib = _load_backend_lib(backend, libname, flags) File "/usr/local/lib/python2.7/site-packages/cffi/api.py", line 731, in _load_backend_lib return backend.load_library(name, flags) OSError: cannot load library /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyfilterbank-0.0.0-py2.7.egg/pyfilterbank/sosfilt.so: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyfilterbank-0.0.0-py2.7.egg/pyfilterbank/sosfilt.so, 2): no suitable image found. Did find: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyfilterbank-0.0.0-py2.7.egg/pyfilterbank/sosfilt.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

please could you help me?

SiggiGue commented 8 years ago

The installer does not include the compilation of sosfilt.c so you need to compile it yourself and place the resulting library into your repo before installation via setup.py.

bfrax commented 8 years ago

dear SiggiGue,

Many thanks for your help,

the command line:

gcc -c -std=c99 -O3 sosfilt.c gcc -shared -o sosfilter.so sosfilter.o