【Python】Linux下使用pip3进行Pygame的安装

pip3:

pip是一个以Python计算机程序语言写成的软件包管理系统
他可以安装和管理软件包,另外不少的软件包也可以在“Python软件包索引”(Python Package Index,简称PyPI)中找到。
pip3就是Python3的pip

安装pip3:

# sudo apt install python3-pip

在这里插入图片描述

pygame:

pygame是基于python的游戏开发套件,一个第三方模块。

安装&验证pygame:

# sudo pip3 install pygame

安装途中可能会提示类似如下代码:
The directory '/home/shame/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/shame/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
直接忽略,如果不动了,可以按一下回车试一下,以下是安装过程:
(出现Successfully......提示后则安装成功)

然后使用
# python3 -m pygame.examplesap.aliens
进行验证,出现Hello.......表示OK!

在这里插入图片描述

导入&使用pygame:

# ipython3
# import pygame

提示如下版本信息后,即可:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

在这里插入图片描述
OK!剩下的使用就与本文章无关了,有时间再为大家更新新的篇章!Bye~~

发布了44 篇原创文章 · 获赞 68 · 访问量 5132

猜你喜欢

转载自blog.csdn.net/qq_25404477/article/details/100740605