Install the development libraries and dependencies needed to install pygame.
Download pygame from github, build, then install!
Here are the dependencies for pygame 2 (using SDL2) and using Python 3. These instructions are tested to work on Ubuntu 22.04 and 24.04.
sudo apt-get update
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev build-essential python3-setuptools python3-dev python3-numpy python3-pip python3-virtualenv cython3 python3-full
git clone https://github.com/pygame/pygame.git
cd pygame
python3 setup.py -config -auto
python3 setup.py build
python3 setup.py install --user
# python3 -m pygame.examples.aliens
# python3 -m pygame.tests
Note to self: we can test the install instructions with this code:
vagrant init ubuntu/bionic64
vagrant up
vagrant ssh
These are instructions to build and install pygame 1. You probably don't need these, and the above instructions are the recommended ones to follow
#install dependencies
sudo apt-get install git python-dev python-numpy python-opengl \
libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \
libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev \
libtiff5-dev libx11-6 libx11-dev fluid-soundfont-gm timgm6mb-soundfont \
xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic fontconfig fonts-freefont-ttf libfreetype6-dev
# Grab source
git clone git@github.com:pygame/pygame.git
# Finally build and install
cd pygame
python setup.py build
sudo python setup.py install
# Run some tests
python -m pygame.tests
python -m pygame.examples.aacircle
python -m pygame.examples.aliens
python -m pygame.examples.freetype_misc
python -m pygame.examples.glcube
python -m pygame.examples.sound
python -m pygame.examples.stars
#install dependencies
sudo apt-get install git python3-dev python3-setuptools python3-numpy python3-opengl \
libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \
libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev \
libtiff5-dev libx11-6 libx11-dev fluid-soundfont-gm timgm6mb-soundfont \
xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic fontconfig fonts-freefont-ttf libfreetype6-dev
# Grab source
git clone git@github.com:pygame/pygame.git
# Finally build and install
cd pygame
python3 setup.py build
sudo python3 setup.py install
# Run some tests
python3 -m pygame.tests
python3 -m pygame.examples.aacircle
python3 -m pygame.examples.aliens
python3 -m pygame.examples.freetype_misc
python3 -m pygame.examples.glcube
python3 -m pygame.examples.sound
python3 -m pygame.examples.stars
To install pygame into a virtual environment it is recommended to first install and configure virtualenvwrapper.
# Install dependencies
sudo apt-get install git python3-dev python3-numpy \
libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \
libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev libfreetype6-dev
# Grab source
git clone git@github.com:pygame/pygame.git
# Build pygame
cd pygame
python3 setup.py build
# Create and activate the virtual environment
mkvirtualenv NAME_OF_PROJECT --python=/usr/bin/python3
workon NAME_OF_PROJECT
# Install into the virtual environment
python3 setup.py install --prefix="$HOME/.virtualenvs/NAME_OF_PROJECT"
For this to work you must first follow the instructions to install the development dependencies for the version of python you're targeting as pip will download the source for pygame from bitbucket and compile it.
As an added bonus, if you add pygame to your requirements.txt and you also setup a virtual environment, pip will automatically install pygame into the virtual environment for you.
# System-wide installation WARNING: This is not advised! Don't do this if you don't know what you're doing!
sudo pip install https://github.com/pygame/pygame.git
There is a bug in python3-opengl-3.0.2-1 in Ubuntu Xenial, this can be circumvented by installing https://launchpad.net/ubuntu/yakkety/amd64/python3-opengl/3.1.0+dfsg-1 from Yakkety. Download the package http://launchpadlibrarian.net/260965664/python3-opengl_3.1.0+dfsg-1_all.deb or a more recent version and install with sudo dpkg -i python3-opengl_3.1*.deb
.
Building is not concerned with the availability of the package python-opengl or python3-opengl. Running the tests or running the example glcube however does need one of these packages. When OpenGL is not applicable, the test can be run in such a way to skip the OpenGL tests:
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk python -m pygame.tests --exclude opengl
#or
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk python3 -m pygame.tests --exclude opengl
For the time being, this is parked here but needs to find a place to a wiki page called CompileDebian which doesn't exist. The above also applies for Raspbian with the exception that instead of timgm6mb-soundfont the package musescore-soundfont-gm needs to be installed.
JAPANESE PATTERN-DESIGNER. JAPANESE PATTERN-DESIGNER. All that warm afternoon we paid the tiresome penalty of having pushed our animals too smartly at the outset. We grew sedate; sedate were the brows of the few strangers we met. We talked in pairs. When I spoke with Miss Harper the four listened. She asked about the evils of camp life; for she was one of that fine sort to whom righteousness seems every man's and woman's daily business, one of the most practical items in the world's affairs. And I said camp life was fearfully corrupting; that the merest boys cursed and swore and stole, or else were scorned as weaklings. Then I grew meekly silent and we talked in pairs again, and because I yearned to talk most with Camille I talked most with Estelle. Three times when I turned abruptly from her to Camille and called, "Hark!" the fagged-out horses halted, and as we struck our listening pose the bugle's faint sigh ever farther in our rear was but feebly proportioned to the amount of our gazing into each other's eyes. "I'm glad you didn't," Bruce smiled. "What a sensation those good people will have presently! And most of them have been on intimate terms with our Countess. My darling, I shall never be easy in my mind till you are out of that house." Those manifestations of sympathy which are often so much more precious than material assistance were also repugnant to Stoic principles. On this subject, Epict¨ºtus expresses himself with singular harshness. ¡®Do not,¡¯ he says, ¡®let yourself be put out by the sufferings of your friends. If they are unhappy, it is their own fault. God made them for happiness, not for misery. They are grieved at parting from you, are they? Why, then, did they set their affections on things outside themselves? If they suffer for their folly it serves them right.¡¯93 You are awfully good, Daddy, to bother yourself with me, when you're ¡°Some strong, pungent liquid had been poured on the green necklace,¡± the letter from the millionaire stated. ¡°No alarm was given. My wife did not want to broadcast either the fact that she had the real gems or the trouble in the hotel. But people had heard the ¡®fire!¡¯ cry and doubtless some suspected the possible truth, knowing why she was getting ready. ¡°But the switches that control the motor for the drum are right out on the wall in plain sight,¡± he told himself, moving over toward them, since the rolling door was left wide open when the amphibian was taken out. ¡°Yes, here they all are¡ªthis one up for lifting the door, and down to drop it. And that switch was in the neutral¡ª¡®off¡¯¡ªposition when we were first here¡ªand it¡¯s in neutral now.¡± The strong sense, lively fancy, and smart style of his satires, distinguished also Pope's prose, as in his "Treatise of the Bathos; or, the Art of Sinking in Poetry;" his "Memoirs of P. P., Clerk of this Parish"¡ªin ridicule of Burnet's "Own Times"¡ªhis Letters, etc. In some of the last he describes the country and country seats, and the life there of his friends; which shows that, in an age more percipient of the charm of such things, he would have probably approached nearer to the heart of Nature, and given us something more genial and delightful than anything that he has left us. The taste for Italian music was now every day increasing; singers of that nation appeared with great applause at most concerts. In 1703 Italian music was introduced into the theatres as intermezzi, or interludes, consisting of singing and dancing; then whole operas appeared, the music Italian, the words English; and, in 1707, Urbani, a male soprano, and two Italian women, sang their parts all in Italian, the other performers using English. Finally, in 1710, a complete Italian opera was performed at the Queen's Theatre, Haymarket, and from that time the Italian opera was regularly established in London. This led to the arrival of the greatest composer whom the world had yet seen. George Frederick Handel was born at Halle, in Germany, in 1685. He had displayed wonderful genius for music as a mere child, and having, at the age of seven years, astonished the Duke of Saxe Weissenfels¡ªat whose court his brother-in-law was a valet¡ªwho found him playing the organ in the chapel, he was, by the Duke's recommendation, regularly educated for the profession of music. At the age of ten, Handel composed the church service for voices and instruments; and after acquiring a great reputation in Hamburg¡ªwhere, in 1705, he brought out his "Almira"¡ªhe proceeded to Florence, where he produced the opera of "Rodrigo," and thence to Venice, Rome, and Naples. After remaining in Italy four years, he was induced to come to England in 1710, at the pressing entreaties of many of the English nobility, to superintend the opera. But, though he was enthusiastically received, the party spirit which raged at that period soon made it impossible to conduct the opera with any degree of self-respect and independence. He therefore abandoned the attempt, having sunk nearly all his fortune in it, and commenced the composition of his noble oratorios. Racine's "Esther," abridged and altered by Humphreys, was set by him, in 1720, for the chapel of the Duke of Chandos at Cannons. It was, however, only by slow degrees that the wonderful genius of Handel was appreciated, yet it won its way against all prejudices and difficulties. In 1731 his "Esther" was performed by the children of the chapel-royal at the house of Bernard Gates, their master, and the following year, at the king's command, at the royal theatre in the Haymarket. It was fortunate for Handel that the monarch was German too, or he might have quitted the country in disgust before his fame had triumphed over faction and ignorance. So far did these operate, that in 1742, when he produced his glorious "Messiah," it was so coldly received that it was treated as a failure. Handel, in deep discouragement, however, gave it another trial in Dublin, where the warm imaginations of the Irish caught all its sublimity, and gave it an enthusiastic reception. On its next presentation in London his audience reversed the former judgment, and the delighted composer then presented the manuscript to the Foundling Hospital, where it was performed annually for the benefit of that excellent institution, and added to its funds ten thousand three hundred pounds. It became the custom, from 1737, to perform oratorios[156] on the Wednesdays and Fridays in Lent. Handel, whose genius has never been surpassed for vigour, spirit, invention, and sublimity, became blind in his latter years. He continued to perform in public, and to compose, till within a week of his death, which took place on April 13, 1759. The Deacon took his position behind a big black walnut, while he reconnoitered the situation, and got his bearings on the clump of willows. He felt surer than ever of his man, for he actually saw a puff of smoke come from it, and saw that right behind the puff stood a willow that had grown to the proportions of a small tree, and had its bark rubbed off by the chafing of driftwood against it. "Certainly. I see it very plainly," said the Surgeon, after looking them over. "Very absurd to start such a report, but we are quite nervous on the subject of smallpox getting down to the army. "Yes, just one." Reuben pulled up his chair to the table. His father sat at one end, and at the other sat Mrs. Backfield; Harry was opposite Reuben. Reuben counted them¡ªten. Then he pushed them aside, and began rummaging in the cart among cabbages and bags of apples. In a second or two he had dragged out five more rabbits. Robert stood with hanging head, flushed cheeks, and quivering hands, till his father fulfilled his expectations by knocking him down. HoMEBT ÏÂÔØ ÀïÃÀÓÈÀûæ« ENTER NUMBET 0016www.gzyhncp.com.cn