fatal error: 'longintrepr.h' file not found

31 Views Asked by At

I'm trying to set up a new Conda environment on my macOS for Python developing. However, I'm encountering an issue when attempting to install Pygame via pip within this environment. Below are the steps I've taken and the error message I've received:

% conda create -n snakegame python
% conda activate snakegame


(snakegame) % conda install sdl2
(snakegame) % pip install pygame==2.1.2

However, during the installation process, I encountered an error when building the wheel for Pygame. The relevant part of the error message is as follows:

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [13 lines of output]
    src_c/_sdl2/sdl2.c:211:12: fatal error: 'longintrepr.h' file not found
      #include "longintrepr.h"
               ^~~~~~~~~~~~~~~
    1 error generated.
    
    error: command '/usr/bin/clang' failed with exit code 1

How to solve it?

0

There are 0 best solutions below