scikit-learn: Importing scikit-learn==0.24.0 fails on macOS 10.13: "Symbol not found: ____chkstk_darwin"
Describe the bug
Importing scikit-learn==0.24 fails on macOS 10.13.
I believe this is similar to https://github.com/nodegui/nodegui/issues/391, i.e. the prebuilt libomp binary (from 10.15) isn’t compatible with macOS 10.13.
We’re also tracking this issue on the project where we encountered it: https://github.com/neuropoly/spinalcordtoolbox/issues/3121.
Steps/Code to Reproduce
- Install
scikit-learn==0.24.0on macOS 10.13 (for us, it appeared as a successful install) - Import
scikit-learn(for us, an error was thrown)
Expected Results
No error is thrown.
Actual Results
dlopen(/Users/travis/build/neuropoly/spinalcordtoolbox/python/envs/venv_sct/lib/python3.6/site-packages/sklearn/__check_build/_check_build.cpython-36m-darwin.so, 2): Symbol not found: ____chkstk_darwin
Referenced from: /Users/travis/build/neuropoly/spinalcordtoolbox/python/envs/venv_sct/lib/python3.6/site-packages/sklearn/__check_build/../.dylibs/libomp.dylib (which was built for Mac OS X 10.15)
Expected in: /usr/lib/libSystem.B.dylib
in /Users/travis/build/neuropoly/spinalcordtoolbox/python/envs/venv_sct/lib/python3.6/site-packages/sklearn/__check_build/../.dylibs/libomp.dylib
___________________________________________________________________________
Contents of /Users/travis/build/neuropoly/spinalcordtoolbox/python/envs/venv_sct/lib/python3.6/site-packages/sklearn/__check_build:
__init__.py __pycache__ _check_build.cpython-36m-darwin.so
setup.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
Versions
- Python:
python-3.6.12 - Numpy:
numpy-1.19.4 - Scipy:
scipy-1.5.4 - Scikit-learn:
scikit-learn-0.24.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 16 (13 by maintainers)
Thank you very much for the confirmation. We will include this fix in a 0.24.1 release (soon-ish).
This was fixed with the 0.24.1 release a few days ago.
For anyone who stumbles on this in the meantime (looks like the awesome scikit-learn team is going to have a fix soon, regardless), using
pip install -U scikit-learn==0.23solves this problem.I created a repo call sklearn_osx_travis_test just to test the install of the scikit-learn wheels on osx 10.13. When we build the wheels for scikit-learn 0.24.1 to fix this issue, we can submit a PR to sklearn_osx_travis_test to make sure that this issue is fixed before uploading the wheels to pypi.
Note that 0.23.2 has some bugfixes over 0.23.0 and was built using the previous CI infrastructure, so it has good chance to also work while waiting for 0.24.0.post1 or 0.24.1 with a proper fix.
Awkwardly, curl/wget don’t seem to like that link. But, I did test it in this CI build.
I’m not getting the error I was getting previously, so the fix seems like it’s working. 🙂
[Update]
scikit-learn >= 0.24.1solved this issue.Error:
libomp.dylib (which was built for Mac OS X 10.15)Versions
High Sierra 10.13.6python@3.8 3.8.6_20.24.0Interim solution
Fallback to
0.23.0previous version ofscikit-learnsolved the issue inrequirements.txt:Full Log
Possibly relevant:
https://github.com/scikit-learn/scikit-learn/blob/2f09bbb7eb2fffdffcca3667b8fc38990d3b0893/build_tools/github/build_wheels.sh#L6-L15
Also possibly relevant is:
https://github.com/nodegui/nodegui/issues/391#issuecomment-582788859
Thanks for looking into this @ogrisel . On apprecie l’aide, même que c’est déjà les vacances dans le plupart des lieux.