Segmentation fault: 11 when trying to run Pygame
<p>I am using OSX 10.11.6, Python 2.17.12 and Pygame 1.9.1.
I made this simple program that should display a black rectangle in the middle of a white field. However, when I try to run it I get an error saying:</p>

<pre><code>Segmentation fault: 11
</code></pre>

<p>I have tried several things, but nothing seems to work. Here is my code:</p>

<pre><code>import pygame

pygame.init()

white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)

gameDisplay = pygame.display.set_mode((800, 600))
pygame.display.set_caption('Slither')

gameExit = False

while not gameExit:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
        gameExit = True

    gameDisplay.fill(white)
    pygame.draw.rect(gameDisplay, black, [400, 300, 20, 20])

    pygame.display.update()

pygame.quit()
quit()
</code></pre>

<p>Does someone know how I can solve this issue? Thanks in advance!
Note: I am writing my code in Atom, and running it in Terminal using this command:</p>

<pre><code>$ python2.7-32 slither.py
</code></pre>

<p>This is due to a flaw in the built-in SDL library that Pygame depends on. Pygame can create a screen, but attempting to touch it will immediately crash it with Segmentation error 11.</p>

<p>From the official SDL website, go to <a href="https://www.libsdl.org/download-1.2.php" rel="nofollow">the download page</a> and get the runtime library 1.2.15 for Mac. Open the .dmg you downloaded and you'll be given an SDL.framework file. Open /Library/Frameworks in Finder and move the framework file there. You may need to select Replace.</p>

python terminal pygame