Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing Pygame

Tags:

python

pygame

I have installed pip and pygame module a few hours ago and when i try to import pygame module in my python

import pygame
print("well")

file i get this error

'''

Traceback (most recent call last):
  File "f:/VSCode/Alien_Invasion/alien_invasion.py", line 2, in <module>
    from pygame import *
  File "C:\Users\3mosh\AppData\Roaming\Python\Python37\site-packages\pygame\__init__.py", line 130, in <module>
    from pygame.base import *
ModuleNotFoundError: No module named 'pygame.base'

'''


1 Answers

Uninstall pygame before attempting each install with pip3 uninstall pygame.

Try using pip3 install pygame

if that doesn't work, try pip install pygame-menu==2.0.1

Also, if you have python installed multiple times, it could be installed on one of those.

like image 195
itsanantk Avatar answered Feb 08 '26 00:02

itsanantk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!