Redlines are only below pygame keywords

Bug description:
It appears that Pygame keywords have red lines below them in my code. The code still functions perfectly fine I’m just don’t get why there’s redlines below it in my recent replits. It also appears to say that the keywords are not a known member of pygame.

Expected vs Current Behavior:
The expected behavior would be that no red lines appear under the pygame keywords but with the current behavior the red line appears under pygame keywords.

Steps to reproduce:
Go to replit and open pygame, then type a piece of code with pygame keywords in it.

Bug appears at this link:

Screenshot(s)/Screen Recording:

Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36 Edg/118.0.2088.46

Replit Profile:

1 Like

Can you hover your mouse over one of these red underscores to see why Replit shows an error at this point?




1 Like

Yes, pyright incorrectly thinks that some pygame stuff doesn’t exist. I’d like this to be fixed, but it could just be a problem on pygame’s end because of how they do things.

Here’s one solution:
Using pygame-ce instead of pygame is one way. pygame-ce is an alternative to pygame that has everything that pygame has, and was made because of tensions in the community. I use pygame-ce. If you do use it, you don’t have to change any of your code or import statements.

First, remove pygame with the shell command poetry remove pygame.
Then, add pygame-ce with poetry add pygame-ce.
After it installs and you refresh the page, pyright correctly recognizes submodules, and most functions and classes, so there are no more errors or warnings from pyright, and you can utilize code intelligence. (I don’t know why pygame-ce works and pygame doesn’t.)

Another way is pyright configuration, but it isn’t available by default on the pygame template (copy from python template).



Like this?

Just a kill 1 should work here.

It appears that you might have maxed out your account storage.
Check You might want to delete some repls to free up space.
If you have not hit your account limit, try typing kill 1 in the shell.

Then, try to install pygame-ce again.


Great news, the issue is fixed! But how could I prevent this issue from happening again?

But how do I reset the way the console is set up?

  1. You can create a personal template that uses pygame-ce, to fork. Otherwise, you will have to uninstall pygame and install pygame-ce every time (there are many ways to do this).
  2. The new console update is a separate thing. See:
    Please bring back old console feature request
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.