alex-petrenko / faster-fifo

Faster alternative to Python's multiprocessing.Queue (IPC FIFO queue)
MIT License
179 stars 29 forks source link

ImportError: dlopen(...) with Queue #27

Closed NervousEnergy1979 closed 3 years ago

NervousEnergy1979 commented 3 years ago

I'm trying to import the Queue function, but I get this strange error

from faster_fifo import Queue

ImportError: dlopen(/my_folder/.venv/lib/python3.8/site-packages/faster_fifo.cpython-38-darwin.so, 2): Symbol not found: __ZNSt8ios_base4InitD1Ev
  Referenced from: /my_folder/.venv/lib/python3.8/site-packages/faster_fifo.cpython-38-darwin.so
  Expected in: flat namespace
 in /my_folder/.venv/lib/python3.8/site-packages/faster_fifo.cpython-38-darwin.so

I've tried reseting my C profile, reinstalling CLANG etc as per some solutions. but nothing seems to work

export CC=/usr/local/Cellar/gcc/11.2.0/bin/gcc-11

Is this a known issue? How can I fix it?

Hardware / OS: Macbook Pro 13 inch 2020. macOS Catalina version 10.15.4 (19E2269) Processor: 2.3 GHz Quad-Core Intel Core i7

alex-petrenko commented 3 years ago

Hi @ktattan ! Maybe it'd be easier to build from sources in your case? What happens if you download the source and just pip install -e . ?

I think this error has something to do with different parts of your application mixing different C++ standard libraries. The solution may include forcing faster-fifo to use the same C++ standard library as the rest of your application by setting something like: export CLANG_CXX_LIBRARY=libstdc++ before you build from sources.

Can you also try to reproduce this on an empty environment? Do you still see the error?

NervousEnergy1979 commented 3 years ago

Thanks @alex-petrenko I tried that. The issue is resolved for me now, but something else fixed it (a factory reset on my laptop). We can close this issue. I appreciate your help