Как скачать pygame для python
In this article, we will learn how to Install PyGame module of Python on Windows. PyGame is a library of python language. It is used to develop 2-D games and is a platform where you can set python modules to develop a game. It is a user-friendly platform that helps to build games quickly and easily.
Follow the steps given below for the successful installation of Pygame
Step 1: Check for Python Installation
In order to install Pygame, Python must be installed already in your system. To check whether Python is installed or not in your system, open the command prompt and give the command as shown below.
If this command runs successfully, and we are able to get a Python version then we are good to go. Otherwise, we have to install Python in our system, to do this refer to How to install Python on Windows?
Step 2: Check for PIP installation
PIP is a tool that is used to install python packages. PIP is automatically installed with Python 2.7. 9+ and Python 3.4+. Open the command prompt and enter the command shown below to check whether pip is installed or not.
Note: Refer to How to install PIP on Windows ? for detailed information.
Step 3: Install Pygame
To install Pygame, open the command prompt and give the command as shown below:
Pygame is successfully installed as shown in the image above.
Step 4: Check Whether PyGame is Working or not
Now open a new terminal and import the Pygame library to see whether it is working fine or not in our system. The library is imported successfully means we got success.
How to install Pygame using PIP or an IDE

We will see in this tutorial how to install the pygame module on Windows or MAC using pip or the PyCharm editor.
Introduction
When you’re new to Python programming, the best way to improve your skills is to create mini-games. This allows you to have fun while learning the basics of programming. To develop a game in Python, there are several modules that make it easier to work with graphics (such as rectangles, circles, images, etc…) and sounds. Pygame is one of them.
Pygame is a Python wrapper for the SDL (Simple DirectMedia Layer) library. SDL provides cross-platform access to the underlying multimedia hardware components of your system, such as sound, video, mouse, keyboard and joystick. You can therefore program games and Python programs with Pygame that are supported on different platforms.
By default, Pygame is not installed on the Python programming environment. We will therefore see in this guide the best instructions for installing it on your system.
If you wish to deepen your knowledge in the Pygame Module, I invite you to read this book :
As an Amazon Associate I earn from qualifying purchases. If you purchase a product by using a link on this page, I’ll earn a small commission at no extra cost to you

How to install Pygame for Windows
Install Python
To run the Pygame module, we must have a version of Python on our machine. If you haven’t already done so, it is available here :

Download Latest Version of Python
Click on the version of Python you are interested in and press download. You can install the latest stable version of Python.
Once the download is complete, press the run button. Check the box ”Add Python 3.5 to PATH”.
Make sure the checkboxes for “Optional features” are checked. For the rest, you can leave them as they are. To finalize the installation, press the install button for your computer to complete the installation.
Install Module Pygame
You can get a version of Pygame via this link :
Take the latest version available and click on the link to download the .whl file to your computer.
pygame‑1.9.6‑cp39‑cp39‑win32.whl
You can choose between a 32bits or 64bits version (in this example, we will start with the win32 version).
To install the previously downloaded Pygame module, we need to access the Windows command line.
To access it, right-click on the started menu and click on Execute. Then type on the text box “cmd“.
Then go to the directory where you installed the Pygame module (by default in the Downloads folder).
Once you are in the right folder, type the following command prompt:
To check that the installation has worked, type the following command prompt:
If you do not see any error messages, the installation went well.
How to install Pygame for OS X
The first step to do is to access the command line. To do so, click on the Spotlight icon and type “terminal” to find it.
We will install XCode (which is an Apple tool for creating Mac and iOS applications. Once the installation is complete, type the following command prompt:
Install Homebrew
Homebrew is a package manager for Mac that simplifies the installation of many different software or packages such as Git, Python or Pygame. Homebrew allows you to avoid possible security issues related to the use of the sudo command to install software like Node.
To install it, copy and paste this on the command prompt:
You will also need to install Homebrew Cask :
Install pygame and these Requirements
To install pygame, we must first install all the pygame dependencies. To do this, please run the following commands one at a time:
As you can see, we have installed python 3 and the pygame module. To check that the installation has been successful, type the following commands:
If you don’t get any error messages, it means that the installation was successful.
How to install Pygame using PyCharm IDE
PyCharm is an integrated development environment (IDE) used in computer programming, specifically for the Python language. PyCharm is cross-platform, with Windows, macOS and Linux versions.
To start opening Pycharm and create a new python project. Then create a python file by right-clicking on the project then New then Python file. Name your python file as you wish.
In your python file, type the following line :
You will see that the pygame is underlined in red. To install pygame, move the mouse over the red underlined area and click on “install package pygame“.
Wait for Pycharm to install pygame and that’s it !

PyCharm IDE : How to install pygame module
Conclusion
In this tutorial, we have seen how to install pygame on Windows, OS X and using an IDE like PyCharm. Now it’s up to you to create your first 2D mini-game!
Here is an example of what you can do with Pygame :
Don’t hesitate to tell me in the comments if you have problems with the pygame installation. And also, I would be happy to see your future projects on pygame!
I’m a data scientist. Passionate about new technologies and programming I created this website mainly for people who want to learn more about data science and programming 🙂
10 Get Start PyGame
PyGame is a Free and Open Source Python programming library for making multimedia application like games.
PyGame is highly portable and runs on nearly every platform and operating system. Millions of people have downloaded pygame itself, which is a whole lot of bits flying across the webs.
10.1 Install PIP and PyGame
10.1.1 update PIP
PIP is a package manager for Python packages, or modules if you like.
If you have Python version 3.4 or later, PIP is included by default.
You may need update your pip version,
Run below command in command line:

Note The package is installed to particular version of python you are using. Make sure you which version of python you are using: py -V
py is the short command of Python in some Windows system, if you didn’t have py command, you could create a Windows alias by run doskey py=python If you have multiple version of Python installed in your system, python and py may point to different version of Python.
If you use Mac, you will need use python3 other than use py or python in windows.
10.1.2 install pyGame
Use the Command to install PyGame
py -m pip install -U pygame —user 
Check your pygame version pip show pygame
Test if you pygame is installed py -m pygame.examples.aliens 
Note If install pygame failed, you may need install a old version of python 3.10.x
pygame 2.4.0
Pygame is a free and open-source cross-platform library for the development of multimedia applications like video games using Python. It uses the Simple DirectMedia Layer library and several other popular libraries to abstract the most common functions, making writing these programs a more intuitive task.
We need your help to make pygame the best it can be! New contributors are welcome.
Installation
If you are just getting started with pygame, you should be able to get started fairly quickly. Pygame comes with many tutorials and introductions. There is also full reference documentation for the entire library. Browse the documentation on the docs page. You can also browse the documentation locally by running python -m pygame.docs in your terminal. If the docs aren’t found locally, it’ll launch the online website instead.
The online documentation stays up to date with the development version of pygame on github. This may be a bit newer than the version of pygame you are using. To upgrade to the latest full release, run pip install pygame —upgrade in your terminal.
Best of all, the examples directory has many playable small programs which can get you started playing with the code right away.
Pygame is a powerful library for game development, offering a wide range of features to simplify your coding journey. Let’s delve into what Pygame has to offer:
Graphics: With Pygame, creating dynamic and engaging graphics has never been easier. The library provides simple yet effective tools for 2D graphics and animation, including support for images, rectangles, and polygon shapes. Whether you’re a seasoned game developer or just starting out, Pygame has you covered.
Sound: Pygame also includes support for playing and manipulating sound and music, making it easy to add sound effects and background music to your games. With support for WAV, MP3, and OGG file formats, you have plenty of options to choose from.
Input: Pygame provides intuitive functions for handling keyboard, mouse, and joystick input, allowing you to quickly and easily implement player controls in your games. No more struggling with complex input code, Pygame makes it simple.
Game Development: Lastly, Pygame provides a comprehensive suite of tools and features specifically designed for game development. From collision detection to sprite management, Pygame has everything you need to create exciting and engaging games. Whether you’re building a platformer, puzzle game, or anything in between, Pygame has you covered.
Building From Source
If you want to use features that are currently in development, or you want to contribute to pygame, you will need to build pygame locally from its source code, rather than pip installing it.
Installing from source is fairly automated. The most work will involve compiling and installing all the pygame dependencies. Once that is done, run the setup.py script which will attempt to auto-configure, build, and install pygame.
Much more information about installing and compiling is available on the Compilation wiki page.
Credits
Thanks to everyone who has helped contribute to this library. Special thanks are also in order.