1

So I am trying to run this:

import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *

But an error pos up and says:

import pygame
ImportError: No module named pygame

and sometimes it says this:

Traceback (most recent call last):
  File "/Users/Abood/Documents/lol.py", line 3, in <module>
    from OpenGL.GL import *
ModuleNotFoundError: No module named 'OpenGL.GL'

However, this works on IDLE version 2.7.16 and Sublime text, even though I tried changing PyCharm's Settings to python 2.7.16 and added Anaconda.

I am 13 and new to Coding, anything would help.

Thank you

2 Answers2

4

Check if you have installed pygame module in your Project Interpreter environment.

You can find the environment:

  Preferences -> Project:Your Project -> Project Interpreter

If you are using anaconda environment, then install the module by running:

  conda install -c cogsci pygame
Varsha
  • 319
  • 1
  • 5
0

If you are using PyCharm and you want to import new modules in it... Open PyCharm click on "File" > "settings" > "Project:Practice" > "Project Interpreter" then click on "+" sign in the right corner then , search for your module select it and then click on "Install Package" to install.