Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS 10.12 Install fails: 'float.h' file not found #1256

Closed
malcolmsailor opened this issue Mar 28, 2018 · 6 comments
Closed

MacOS 10.12 Install fails: 'float.h' file not found #1256

malcolmsailor opened this issue Mar 28, 2018 · 6 comments

Comments

@malcolmsailor
Copy link

Hello,

I am getting the following installation error when attempting to install psutil with pip on macOS 10.12.6.

    In file included from psutil/_psutil_osx.c:36:
    In file included from /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
    In file included from /Library/Developer/CommandLineTools/usr/lib/clang/9.0.0/include/float.h:36:
    /Developer/SDKs/MacOSX10.6.sdk/usr/include/float.h:8:15: fatal error: 'float.h' file not found
    #include_next <float.h>
                  ^~~~~~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1

As best I can tell, both float.h files that are found have #include_next <float.h> statements, and after this it cannot find the file in the search path.

This issue is a little over my head. I can easily imagine that the problem with my machine more generally and not a problem with psutil specifically, but I have not previously come across this error before and have been unable to find anything about similar issues online. Any help would be very much appreciated!

@osuskates
Copy link

I am also experiencing this exact same error message. Is there a fix or workaround available?

@nstr10
Copy link

nstr10 commented Apr 5, 2018

float.h is included in gcc, so it sounds like a PATH problem to me. Try locate float.h and ensure that its path is part of your PATH environment variable.

@osuskates
Copy link

@nstr10, thanks for the suggestion, however, after adding the full path to float.h, it was still failing with the same error message that @malcolmsailor was getting. Might you have any other suggestions?

@nstr10
Copy link

nstr10 commented Apr 6, 2018

@osuskates unfortunately I'm not able to reproduce this - did a brew install python3 && pip3 install psutil and it installed without issue. 😕

Only obvious difference is that I'm still on El Capitan (10.11.2).

@rorycurtis
Copy link

I had exactly the same issue with another package and supplying the correct include directory solved it, like this ...

CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include pip3 install ...

You can find the right path to use by running

xcrun --show-sdk-path

lychees added a commit to Andoromeda-Foundation/dapp-examples that referenced this issue Aug 28, 2018
Buy failed to compile with the following error:
giampaolo/psutil#1256
@giampaolo giampaolo added macos and removed osx labels Nov 15, 2020
@giampaolo
Copy link
Owner

Python wheels are now distributed for macOS so this should not be a problem anymore. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants