0

The following is the EXACT output when running the command sudo python -m pip install pygame on raspberry pi:

Collecting pygame
  Using cached pygame-1.9.3.tar.gz
    Complete output from command python setup.py egg_info:


    WARNING, No "Setup" File Exists, Running "config.py"
    Using UNIX configuration...


    Hunting dependencies...
    SDL     : found 1.2.15
    FONT    : found
    IMAGE   : found
    MIXER   : found
    PNG     : found
    JPEG    : found
    SCRAP   : found
    PORTMIDI: not found
    PORTTIME: not found
    FREETYPE: found 2.5.2
    Missing dependencies

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-nOupZN/pygame/

I have tried installing pygame in ways without using pip but all of them fail in other ways and I think this problem may be the easiest to fix. I don't mind the missing dependencies. I know error code 1 is "operation not permitted" error, but i did use sudo, so I don't know why this comes up. I apologize for having so much code, but I wanted to provide as much information as possible. I have no idea what the problem is, but if anyone can help it would be a lifesaver.

Notes:

  • The last line of the output appears in red text in the shell
    • nOupZN is probably just random; I've tried installing multiple times and that part changes each time
  • I am using python 2.7.9 and do not wish to switch
  • I have recently upgraded pip
  • The error still occurs even when using the --user flag
  • The error still occurs even when running sudo su beforehand
3
  • it seems your problem in PORTMIDI: not found, PORTTIME: not found and maybe you don't need it but PyGame requires it. Commented Dec 28, 2017 at 4:38
  • using Google I found pygame installation problem on raspberrypi.org Commented Dec 28, 2017 at 5:49
  • I had the same problem - SDL installed, pip upgraded, python2 on the latest version - no dice. Tried python3 - worked straight away. When you say you don't want to switch from python 2, do you realise 2 and 3 can coexist, you just type python3 mygame.py? Commented Jan 29, 2019 at 17:44

1 Answer 1

1
sudo apt-get install python3-pygame

I've been struggling to learn the right way to install stuff on my Pi too. I've just started this past year, and pretty much new to linux. I've converged on this technique working most of the time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.