[PYTHON] Installation of psutil fails on MacOS Cataline

environment

psutil is a cross-platform library for getting the usage status of running processes and systems in Python.

Status

Attempts to install psutil with poetry fail with a large number of error messages.

$ poetry install --no-root
Installing dependencies from lock file

Package operations: 35 installs, 0 updates, 0 removals

  - Installing psutil (5.7.0)

    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_OSX=1 -I/Users/hinata/.ghq/github.com/Nikkei/b2b-api-article/.venv/include -I/Users/hinata/.pyenv/versions/3.8.2/include/python3.8 -c psutil/_psutil_common.c -o build/temp.macosx-10.14-x86_64-3.8/psutil/_psutil_common.o
    In file included from psutil/_psutil_common.c:9:
    In file included from /Users/hinata/.pyenv/versions/3.8.2/include/python3.8/Python.h:25:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdio.h:64:
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:93:16: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
            unsigned char   *_base;
                            ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:93:16: note: insert '_Nullable' if the pointer may be null
            unsigned char   *_base;
                            ^
                              _Nullable
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:93:16: note: insert '_Nonnull' if the pointer should never be null
            unsigned char   *_base;
                            ^
                              _Nonnull
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:138:32: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
            int     (* _Nullable _read) (void *, char *, int);
                                              ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:138:32: note: insert '_Nullable' if the pointer may be null
            int     (* _Nullable _read) (void *, char *, int);
                                              ^
                                               _Nullable
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:138:32: note: insert '_Nonnull' if the pointer should never be null
            int     (* _Nullable _read) (void *, char *, int);
                                              ^
                                               _Nonnull
    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/_stdio.h:138:40: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
            int     (* _Nullable _read) (void *, char *, int);
                                                      ^

I'm getting a lot angry around MacOSX 10.14.sdk.

Cause

My version of Catalyst is 10.15, so when I thought it was strange, there were two sdks.

$ cd /Library/Developer/CommandLineTools/SDKs
$ ls 
MacOSX.sdk      MacOSX10.14.sdk MacOSX10.15.sdk

After erasing 10.14, I was able to install it successfully. It seems that the old ones remained and caused interference.

$ ls sudo rm -rf MacOSX10.14.sdk
Password:
$ ls
MacOSX.sdk      MacOSX10.15.sdk

Recommended Posts

Installation of psutil fails on MacOS Cataline
Apache installation fails on CentOS 8.2
Easy installation of OpenCV on RaspberryPi 3+
If Python 3.5.0 installation fails on Mac
(One of the solutions) when pyenv install on macOS causes BUILD FAILED and Python installation fails.
Addition of local development environment on MacOS
[MacOS] Installation of Go (Go language) using goenv
Installation of Anaconda3
Installation of CentOS 8
Python installation 2020 (macOS)
Installation of Docker on Raspberry Pi and L Chika
Installation of OpenMDAO (version 1.7.1)
Introduction of ferenOS 1 (installation)
[Linux] Installation of nvm
numba installation on mac
Installation of Python 3.3 rc1
Installation on CentOS8 VirtualBox
Installation of matplotlib (Python 3.3.2)
Installation of dlib, cv2
Memo of python + numpy/scipy/pandas/matplotlib/jupyterlab environment construction on M1 macOS (as of 2020/12/24)
What to do if pip install mysqlclient fails on MacOS