【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~~

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我姥爷是校长

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值