A
A
Alexey Anisimov2018-11-25 09:21:11
Python
Alexey Anisimov, 2018-11-25 09:21:11

How to import pygame into a project?

There was a problem importing the pygame library into the project. When viewing the list of installed packages with p, pygame seems to be installed, but when imported into a project, it swears: no module named pygame.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Ternick, 2018-11-25
@Ternick

1) What version of python do you have?
2) Which IDE: PyCharm-> It installs packages by itself.
3) Install pygame - pip install pygame
4) After installation, use - pip list and look for pygame in it, if there is, then in theory everything should work.
5) Try reinstalling first -> pip uninstall pygame, then point 3
6) In theory, everything should work, you can also check the operation of the module like this:
open the console and write py and write import pygame in the interpreter itself, if there are no errors after this line, then problem in IDE :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question