question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to import pygame

See original GitHub issue

When I run a game in pygame the init.py file is created(the pygame module) and I get the following error:

Traceback (most recent call last):
  File "C:\Users\User\Desktop\Γιάννης\python\race\A bit racey.py", line 1, in <module>
    import pygame
  File "C:\Users\User\AppData\Roaming\Python\Python36\site-packages\pygame\__init__.py", line 133, in <module>
    from pygame.base import *
ModuleNotFoundError: No module named 'pygame.base'

The pygame is installed, so the ‘pygame.base’ should exist.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tusarr10commented, Apr 12, 2022

hello friend . just do==> pip3 install pygame

0reactions
Jeeroxzcommented, Aug 5, 2020

@rrraj I had the same issue as you and couldn’t find anything to help me anywhere. I tried out many things and for me the issue was that my python was 32 bit and it couldn’t work with pygame. I uninstalled python and installed a 64 bit version and now everything works well.

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

import pygame fails - python
There is an issue with Pygame being in Python's path. If you are trying to run Pygame through Eclipse like I am. The...
Read more >
No module named 'pygame' in Python
The error "Import "pygame" could not be resolved from source Pylance" occurs when the pygame module is not installed or you have selected ......
Read more >
I can't import the Pygame module. When I'm trying to ...
The error is because your version of Pygame is not compatible with your version of Python or Pydev. Go to this link and...
Read more >
cant import pygame in vscode
I cant get pygame to import in vscode "Unable to import 'pygame'pylint(import-error) ". I tried using pip to install it from my terminal ......
Read more >
Unable to import 'pygame'
I'm having some trouble with my pygame import in VS CODE. Everytime that I try to import the pygame, it gets underlined. Even...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found