0

I'm having a lot of trouble installing pygame. I'm running ubuntu. I'm trying to install it with 'pip install pygame' but I keep getting an error message:

     Unable to run "sdl-config". Please make sure a development version of SDL is installed.

I've tried downloading the source from the pygame website but still its not working i just get the same error when i try and run setup.py.

Any Ideas? Thanks in advance.

1

4 Answers 4

2

The easiest way to install Pygame on Ubuntu is through apt. Just run sudo apt-get install python-pygame, and it will handle all the native dependencies for you. pip is better for pure-python dependencies or if you have to use it (eg, in a virtualenv).

Sign up to request clarification or add additional context in comments.

1 Comment

I did and it was installed, now how do I use this install on Pycharm?
0

If u got error like 404 Not Found when run
sudo apt-get install python-pygame

Then this link can help you
https://community.webfaction.com/questions/315/how-do-i-install-pygame

Comments

0

Here is the solution that worked for me:

sudo apt-get build-dep python-pygame
sudo apt-get install python-dev
sudo apt-get install libv4l-dev
cd /usr/include/linux
sudo ln -s ../libv4l1-videodev.h videodev.h

and finally run the pip command (can be done through virtualenv or conda):

pip install 'Pygame == 1.9.1release' --allow-external Pygame --allow-unverified Pygame

Comments

0

In pycharm specifying a dev version (in my case 2.0.0.dev8) fixed that problem for me.
Here's the after:

enter image description here

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.