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
34 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
+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,710 points
1,959 views
0 votes
1 answer

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

Some of the modules have changed in ...READ MORE

answered Oct 5, 2018 in Python by Priyaj
• 56,160 points
385 views
0 votes
1 answer

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

Some of the modules have changed in ...READ MORE

answered Oct 9, 2018 in Python by Priyaj
• 56,160 points
101 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 133 views
+4 votes
6 answers
0 votes
1 answer

No module named urllib3

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

answered Jan 24 in Python by SDeb
• 12,360 points
801 views
0 votes
1 answer

No module named __future__

In your /PATH/Python-2.7.x/Lib should be all your ...READ MORE

answered Mar 7 in Python by SDeb
• 12,360 points
36 views