Python error "ImportError: No module named pygame.locals"

0 votes

I'm trying to build some random game on python as apart of my project. It's a very simple game but I keep getting me the following error:

ImportError: No module named pygame.locals

How do I get rid of it?

Jun 18 in Python by Harsha
108 views

1 answer to this question.

0 votes

You need to download and install the pygame module provided by python. 

To download and install on Pycharm, follow these steps:

Goto File -> Settings -> click on the tiny plus sign on the right top corner as shown below.

You'll see a search tab, type the module name there. In your case its pygame.

Finally, click on install package and you're good to go!

answered Jun 18 by Greg

Related Questions In Python

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Python error "ImportError: No module named 'tkinter'"

Try installing it from the terminal with ...READ MORE

answered Aug 9 in Python by Trisha
77 views
+3 votes
1 answer

Tensorflow 1.5 ImportError: No module named tensorflow.python.client

I think it's a bug in Tensorflow ...READ MORE

answered Sep 25, 2018 in Python by charlie_brown
• 7,720 points
2,442 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 216 views
+4 votes
6 answers
0 votes
1 answer

Python error " import requests ImportError: No module named requests"

Hi @Vasgi, for the code you're trying ...READ MORE

answered Aug 5 in Python by Layla
76 views
0 votes
1 answer

No module named urllib3

It is possible that either urllib3 is ...READ MORE

answered Jan 24 in Python by SDeb
• 13,160 points
1,210 views