Apr 132021
儿子学python,需要用pygame,我就在mac上装一下。以前python版本是3.7,装完,python版本升级到3.9.
pip3 install pygame
这就装完了。测试一下。
python3 -m pygame.examples.aliens
能看到一个demo,比较有意思。
shake@ShakedeMacBook-Air ~ % python --version
Python 2.7.16
shake@ShakedeMacBook-Air ~ % python3 --version
Python 3.9.2
shake@ShakedeMacBook-Air ~ %
查看一下安装的版本
shake@ShakedeMacBook-Air ~ % python3
Python 3.9.2 (v3.9.2:1a79785e3e, Feb 19 2021, 09:06:10)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
pygame 2.0.1 (SDL 2.0.14, Python 3.9.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
>>> exit ()