Pygame installing not working poetry, pip

Question: How do i add pygame into my Python repl? whenever i run “poetry add pygame” it fails. “pip install pygame” (even with --break-system-packages and --user) it fails with error: externally-managed-environment.

Screenshots, links, or other helpful context:


also, adding this to “pyproject.toml”:

python = ">=3.10.0,<3.11"
pygame = ">2.0.1,<2.6.0"

completely fails after reload of environment.

A link to the repl would be nice.
Just use the official pygame template instead of trying to install it yourself.
Generally, installing pygame with poetry add pygame should work fine. Using the pyproject.toml may lead to annoying dependency conflicts.
(Also, never use pip in replit, use poetry instead.)

I understand pip does not work well. although, if you read the issue, poetry add (*) does NOT work at all.

Hey @hudvhudf!

There is an existing Pygame Template, could you fork this template and move your files here? This template is already configured for Pygame.

1 Like

Hello, can you try the official pygame template? Could you provide a link to your repl?