Fatal error: 'climits' file not found (macOS build failure) #33448
Replies: 3 comments 1 reply
-
|
This is a known issue on macOS when using newer Xcode versions. The climits header was removed in recent macOS SDK versions. Then retry your original install command. Fix 3 — Use conda instead of pip: Fix 4 — Set SDK path manually: Note: Fix 4 is often the most reliable solution for climits not found errors on macOS 13+. The SDKROOT environment variable helps the compiler locate the correct SDK headers. Hope this helps! Let me know if any of these solutions work for you. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @mariouuche, The Let me know if you make any progress or if you need another fresh set of eyes on it! |
Beta Was this translation helpful? Give feedback.
-
|
Just a small clarification: So the issue is probably not in A quick way to confirm the problem is to test whether your compiler can build a minimal C++ file: cat > /tmp/test.cpp <<'EOF'
#include <climits>
#include <iostream>
int main() {
std::cout << INT_MAX << std::endl;
return 0;
}
EOF
clang++ /tmp/test.cpp -o /tmp/test
/tmp/testIf this fails with the same For a developer-mode scikit-learn build, I would try the following order: xcode-select -p
xcrun --show-sdk-path
clang++ -v /tmp/test.cpp -o /tmp/testIf the SDK / command line tools look broken, reinstalling Command Line Tools can help: sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --installThen retry the simple If you are using a conda environment, another robust approach is to use the conda-forge compiler toolchain consistently inside the environment, rather than mixing system clang, Homebrew tools, and conda packages: conda create -n sklearn-dev -c conda-forge python numpy scipy cython meson-python ninja compilers
conda activate sklearn-dev
pip install --no-build-isolation --editable . --verbose --config-settings editable-verbose=trueAlso, So I would summarize it this way:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I'm trying to install scikit-learn in developer mode on macOs. I'm following the official development installation guide.
Everything works until this step:
pip install --editable . --verbose --no-build-isolation --config-settings editable-verbose=true.During compilation, I get:
../../sklearn/svm/src/libsvm/svm.cpp:71:10: fatal error: 'climits' file not found71 | #include <climits>| ^~~~~~~~~1 error generated.I'm using macOS 26.3 and I installed xcode command line tools with
xcode-select --install. I tried resetting xcode, but it didn't fix the compilation issue.Has anyone encountered this before on macOS? Is there something from the installation guide I might be missing?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions