SavantCode
SavantCode

Reputation: 131

run pygame with phycharm

I try to run pygame in Pycharm. The editor show the library. But if I run the program I get an error that it can't find the module: pygame.

I am running python 3.5

I added a picutre: enter image description here

I try it like this:

enter image description here

Thank you

oke, I have done that.See:

enter image description here

So I run again the program:

see image: enter image description here

ok. I am using python: Python 3.4.4.

but if I do this:

pip3 install pygame. I get this warning:

enter image description here

see image: enter image description here

Upvotes: 0

Views: 152

Answers (2)

MatejMecka
MatejMecka

Reputation: 1486

  1. You do not have the PyGame module and even PyCharm suggests it for you.

  2. You do not run pip inside the python IDE. In order to do install a module with pip you have to open the command line and directly run

    Pip install PyGame

Or

Python -m pip install pygame
  1. Based on previous answer on a question like yours: Are you sure you have got pygame for Python 3.5? The version for 3.5 wont work and produce this error msg, because the pyd file wont find the python 3.5 dll.

    EDIT: since you are installing for python2.7 USE PIP3 to install

    pip3 install pygame

  2. Since pygame's pip page is rarely downloaded I suggest you download the module from BitBucket avaivable here.

Upvotes: 0

Szabolcs Dombi
Szabolcs Dombi

Reputation: 5783

then install pygame:

pip install pygame

or:

python -m pip install pygame

or from code:

import pip
pip.main(['install', 'pygame'])

Upvotes: 1

Related Questions