Python Forum

Full Version: (HELP GREATLY APPRECIATED) New user- Huge Pygame Installation Problem!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all Python Enthusiasts!
I recently obtained the Python Crashcourse and am working through the book. I now need to install Pygame for the first big project in this Godsend of a book. Don't worry, I'm not going to just throw my problem out there and wait for someone to solve it for me. You can rest assured I have done my research, dedicated much time to -attempting- to solve it, and have now come to you as a last resort. Here's the problem:

I have two versions of Python on my Linux Chromebook. Python 2.7.13 and Python 3.5.3. I have installed Pip as well. When I enter the command "python3 -m pip install -U pygame --user" an error appears. When I enter the command "python3 -m pip install --user pygame" the same error appears. For context, the second command is from The Python Crashcourse and the first command is from "https://ukdevguy.com/how-to-install-pygame-in-2019/". Here is the error:

"

DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
Collecting pygame
Using cached pygame-2.0.1.tar.gz (5.5 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q2tgkbgf/pygame_817bade74b394020ad397291f1dae3bc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q2tgkbgf/pygame_817bade74b394020ad397291f1dae3bc/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-7h2olhgr
cwd: /tmp/pip-install-q2tgkbgf/pygame_817bade74b394020ad397291f1dae3bc/
Complete output (29 lines):


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

/bin/sh: 1: sdl2-config: not found
/bin/sh: 1: sdl2-config: not found
/bin/sh: 1: sdl2-config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-q2tgkbgf/pygame_817bade74b394020ad397291f1dae3bc/setup.py", line 318, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "/tmp/pip-install-q2tgkbgf/pygame_817bade74b394020ad397291f1dae3bc/buildconfig/config.py", line 221, in main
deps = CFG.main(**kwds)
File "/tmp/pip-install-q2tgkbgf/pygame_817bade74b394020ad397291f1dae3bc/buildconfig/config_unix.py", line 194, in main
DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl']),
File "/tmp/pip-install-q2tgkbgf/pygame_817bade74b394020ad397291f1dae3bc/buildconfig/config_unix.py", line 39, in __init__
self.ver = config[0].strip()
IndexError: list index out of range

Hunting dependencies...
---
For help with compilation see:
https://www.pygame.org/wiki/CompileDebian
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---

----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

"

From reading that error, It seems I need to create a "Setup File". Although, I have no idea what that is and how I can create it. Have you had the same problem, do you know how to solve it, or anything along those lines?

Greatly appreciated,

Jbomb
As the message indicates, your python version Python 3.5 is too old and is not supported. You need uninstall it and install a newer version.