Marie
Marie

Reputation: 21

Failed building wheel for pillow-heif with error Pointer is missing a nullability type specifier

While trying to install Wagtail on MacOS Monterey with pip the build fails with many errors like these:

/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/stdlib.h:134:25: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
      double   atof(const char *);
                               ^
      /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/stdlib.h:134:25: note: insert '_Nullable' if the pointer may be null
      double   atof(const char *);
                               ^
                                _Nullable
      /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/stdlib.h:134:25: note: insert '_Nonnull' if the pointer should never be null
      double   atof(const char *);
                               ^
                                _Nonnull

The final error is:

  ERROR: Failed building wheel for pillow-heif
Failed to build pillow-heif
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pillow-heif)

I looked at similar questions but the answers did not seem to apply to installations with pip.

Is there a workaround for this? Can I install Wagtail without pillow? Thank you for any suggestions.

Upvotes: 1

Views: 117

Answers (1)

Rajeesh Punathil
Rajeesh Punathil

Reputation: 139

I had the same problem. Wagtail requires pillow-heif and pip couldn't build pillow-heif from source, always ending with the same error as yours. Then I went to the pypi repo (https://pypi.org/project/pillow-heif), downloaded and installed the prebuilt wheel file compatible with my OS version and the python version. Since you use MacOS 12, you may have to download wheel for pillow-heif 0.20, from here: https://pypi.org/project/pillow-heif/0.20.0/#files.

  1. Choose the wheel that's compatible with your OS (MacOS 12), python version (CPython 3.11) and the architecture (ARM64 or Intel X86-64).

  2. Install the downloaded wheel of pillow-heif as follows:

    pip install PATH-OF-WHEEL-FILE

  3. Install wagtail as follows:

    pip install wagtail

Upvotes: 0

Related Questions