pip是一個以Python計算機程序語言寫成的軟件包管理系統
他可以安裝和管理軟件包,另外不少的軟件包也可以在“Python軟件包索引”(Python Package Index,簡稱PyPI)中找到。
pip3就是Python3的pip
# sudo apt install python3-pip
pygame是基於python的游戲開發套件,一個第三方模塊。
# 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!
# ipython3
# import pygame
提示如下版本信息後,即可:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
OK!剩下的使用就與本文章無關了,有時間再為大家更新新的篇章!Bye~~