0

So I'm trying to use pygame with Python3.x, but I keep getting an error message which states "No module named pygame." Now if I run it with Python2.x it runs just fine, and I'm able to use everything I want to, like the mixer module.

Does anyone know how I can get this to work on Python3 as well?

I'm using Ubuntu 14.04 LTS.

3
  • 1
    You have to install it for python3 also :/ Commented Nov 6, 2014 at 0:17
  • askubuntu.com/questions/401342/… Commented Nov 6, 2014 at 0:18
  • 1
    In general, when you have multiple Python installations on the same computer, they have their own sets of site packages. Did you not know this (in which case… that's pretty much the whole answer), or did you know this but not know how to install it for Python 3 (in which case this probably belongs on AskUbuntu, where it already has a dup, as @DuhProgrammer13 pointed out)? Commented Nov 6, 2014 at 0:20

1 Answer 1

1
cd ~

sudo apt-get install mercurial
hg clone https://bitbucket.org/pygame/pygame
cd pygame

sudo apt-get install python3-dev 
sudo apt-get install python3-numpy 
sudo apt-get install libsdl-dev 
sudo apt-get install libsdl-image1.2-dev 
sudo apt-get install libsdl-mixer1.2-dev 
sudo apt-get install libsdl-ttf2.0-dev 
sudo apt-get install libsmpeg-dev 
sudo apt-get install libportmidi-dev 
sudo apt-get install libavformat-dev 
sudo apt-get install libswscale-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libfreetype6-dev

python3 setup.py build
sudo python3 setup.py install
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.