Pygame_How to Install Pygame to Python 3 on Ubuntu

來源:互聯網
上載者:User

Installation

Start by installing all necessary dependencies, and mercurial and checkinstall for the installation:

1 sudo apt-get install python3-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev checkinstall mercurial

Then download the latest version of the
Pygame source code with the following command (this uses mercurial):

1 hg clone

https://bitbucket.org/pygame/pygame

Go into the downloaded Pygame directory:

1 cd pygame

Compile the source code by typing this command into the terminal:

1 python3 setup.py build

Finally install Pygame by doing this:

1 sudo checkinstall python3 setup.py install

Extra stuff

Click here to read why you should use checkinstall.

Use this command to see information about your pygame installation:

1 apt-get cache show pygame

And this command to uninstall Pygame:

1 dpkg -r pygame

or:

1 sudo apt-get remove pygame

Notes

The most recent stable pygame version when writing this is 1.9.1 (August 2009). I did this installation on Ubuntu 12.04 and this was needed since there isn’t a python3-pygame available in the repository.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.