0

In my GitHub Actions workflow, I have the following step:

run: |
  pip3 install pygame

which results in following error:

Collecting pygame
  Downloading pygame-1.9.6.tar.gz (3.2 MB)
    ERROR: Command errored out with exit status 1:
     command: /opt/hostedtoolcache/Python/3.9.0/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kswqgf01/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kswqgf01/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zlsswybj
         cwd: /tmp/pip-install-kswqgf01/pygame/
    Complete output (12 lines):
    
    
    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using UNIX configuration...
    
    /bin/sh: 1: sdl-config: not found
    /bin/sh: 1: sdl-config: not found
    /bin/sh: 1: sdl-config: not found
    Unable to run "sdl-config". Please make sure a development version of SDL is installed.
    
    Hunting dependencies...
    WARNING: "sdl-config" failed!
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Error: Process completed with exit code 1.

What is causing that error, and how can that be fixed so I can perform unit tests for my Python program?

1 Answers1

0

This works for me:

name: install-pygame
on: [push]
jobs:
  check-pygame:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
      with:
        python-version: '3.6' # Version range or exact version of a Python version to use, using SemVer's version range syntax
        architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
    - run: |
        python -m pip install --upgrade pip
        python3 -m pip install pygame==2.0.0.dev12

Please check this topic and this instruction

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107