How to install pygame on Linux?

藏色散人
Release: 2020-09-14 15:20:18
Original
8057 people have browsed it

If you are using a Linux system and Python 3, you need to use pip to install Pygame. pip is a program that downloads and installs Python packages for you.

How to install pygame on Linux?

#1. First check whether pip is installed.

pip --version
Copy after login

Or use find / -name pip to check whether it has been installed. If it is installed, the installation path will be found. At the same time, if it is installed, but the prompt pip: command not found is displayed, you need to create a soft link to let the system recognize the pip command:

ln -sv /usr/local/python3/bin/pip /usr/bin/pip
Copy after login

2. If it is not installed, you need to install it manually.

First download the get-pip.py file:

wget  https://bootstrap.pypa.io/get-pip.py
Copy after login

If wget is not installed on the system, you can use yum install wget to install it, but an external network is required.

Then use the downloaded get-pip.py script to install PIP:

python3 get-pip.py
Copy after login

3. Use pip to install pygame:

pip install pygame 
或者
pip install --user hg+http://bitbucket.org/pygame/pygame
Copy after login

The above is the detailed content of How to install pygame on Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template