implicit library not loading in osx
After installing v. 0.4.2 implicit on my macbook, I get a traceback error when running in python3 after running: import implicit
Catalina 10.15.6 Python 3.7.8 (v3.7.8:4b47a5b6ba, Jun 27 2020, 04:47:50) [Clang 6.0 (clang-600.0.57)] on darwin
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/implicit/__init__.py", line 1, in <module>
from . import als, approximate_als, bpr, lmf, nearest_neighbours
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/implicit/als.py", line 14, in <module>
from . import _als
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/implicit/_als.cpython-37m-darwin.so, 2): Symbol not found: _GOMP_parallel
Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/implicit/_als.cpython-37m-darwin.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/implicit/_als.cpython-37m-darwin.so
I understand this is related to the c++ libraries. Tried installing conda install libgcc and conda install llvm but there was no change in error.
I believe fundamental problem is related to implicit trying to access libstdc++ vs the newer libc++.
Appears installing glove also has a similar issue https://github.com/maciejkula/glove-python/issues/112
I'm also having the same problem - did you find a solution?
I had similar issues with installation and subsequently importing.
MacOS: Mojave 10.14.5 GCC: gcc@9
I resolved as follows:
- reinstall xcode command line tools (according to this, Mojave deletes
user/includeupon installation):
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
cd /Library/Developer/CommandLineTools/Packages/
open macOS_SDK_headers_for_macOS_10.14.pkg
-
checkout the implicit source and checkout tag v0.4.0
-
python setup.py install
Hi @gregross that's a good suggestion for Mojave users. Unfortunately, that path (and pkg file) no longer exists in Catalina.
Update: I fixed problem via this comment:
brew update
brew upgrade
brew cleanup
And then re-installing via pip install implicit in my active environment.