I’m trying to load a pip requirements file on Raspberry PI Bookworm. Get through the modules in the file then hit, what I assume, are dependencies raised by one or more modules. I’ve hit a number of problems with pygame which I’ve overcome until this one. Looking for:
Finding the module(s) that need pygame to see if I need them e.g. look for Import statement in my library
Unpack this error to fix it. Note specific version asked for. I can install the latest one no problem but that is not in the version range looked for.
Collecting pygame<2.0,>=1.9.2
Using cached pygame-1.9.6.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
Missing dependencies
Hunting dependencies...
SDL : found 1.2.15
FONT : not found
IMAGE : not found
MIXER : not found
PNG : found
JPEG : not found
SCRAP : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 26.2.20
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(wc) pi@wethCAM:/media/work/bw $
Thanks @merwok but don’t spend too much time on this. I’ve made progress.
I decided to convert the REQUIREMENTS file into a BASH script with individual PIP INSTALL’s so I could see more clearly where each was failing. This approach also exposed more issues. When checking the failed modules against the IMPORT of my Python scripts I eliminated a number of modules that weren’t being used.
I’m at the point now of running each Python script to verify it works.
Present observation is that requirement file is good as long as you are staying in the same version of Python. I’m going from 3.9 to 3.11 and PIP’s not happy.
So did you find which requirement caused the import of pygame?
A few ideas to get pygame installed:
on raspberry pi, you could try installing python3-pygame with apt, if the version available there matches what you need (pip will see that pygame is already installed so won’t try to get it from pypi – some caveats apply if you’re using a virtualenv)
BTW, your list of requirements seems strange (for example arandr is a program I use to configure my screens but I don’t see how it would be a dependency of another program): where does it come from?
And you’re right that it can be complicated to find out why something is installed (I use pipdeptree sometimes but it only helps after installing packages), and to update versions to get latest releases or to use a newer Python version. I have been using pip-compile for years to make this easier.