python-soundfile icon indicating copy to clipboard operation
python-soundfile copied to clipboard

Can't import soundfile when docker running

Open toren332 opened this issue 6 years ago • 6 comments

In simple run application everything okay, But when try to launch my app I've got the error: File "/code/api_v1/urls.py", line 3, in from . import views File "/code/api_v1/views.py", line 11, in import soundfile as sf File "/usr/local/lib/python3.7/site-packages/soundfile.py", line 267, in _snd = _ffi.dlopen('sndfile') File "/usr/local/lib/python3.7/site-packages/cffi/api.py", line 146, in dlopen lib, function_cache = _make_ffi_library(self, name, flags) File "/usr/local/lib/python3.7/site-packages/cffi/api.py", line 828, in _make_ffi_library backendlib = _load_backend_lib(backend, libname, flags) File "/usr/local/lib/python3.7/site-packages/cffi/api.py", line 823, in _load_backend_lib raise OSError(msg) OSError: ctypes.util.find_library() did not manage to locate a library called 'sndfile'

toren332 avatar Jun 20 '19 18:06 toren332

Do you have libsndfile installed in your docker container? SoundFile doesn't seem to think so.

bastibe avatar Jun 21 '19 07:06 bastibe

The same problem. libsndfile1 is installed

gvammer avatar Nov 07 '19 10:11 gvammer

As the error states, ctypes.util.find_library() is unable to locate sndfile. You'll have to check your paths and include libsndfile in the library search path.

bastibe avatar Nov 07 '19 10:11 bastibe

Khi lỗi trạng thái, ctypes.util.find_library()không thể định vị sndfile. Bạn sẽ phải kiểm tra các đường dẫn của mình và đưa libsndfile vào đường dẫn tìm kiếm thư viện.

Can you explain detailed it for me ? Thanks !

DungLeMTA avatar Aug 24 '21 08:08 DungLeMTA

This is a problem on your computer. You have to configure your system so ctypes.util.find_library() can find libsndfile.

bastibe avatar Aug 29 '21 11:08 bastibe