如何在安装了多个 python 的(Ubuntu)系统上安装 pygame?

如何在安装了多个 python 的(Ubuntu)系统上安装 pygame?

在我的 ubuntu 机器上,我安装了 python2.6 和 python 3.1。我使用 pygame / python2.6 做了一些工作,现在我想使用 python3.1 / pygame。但是,在空闲状态下(使用 python3.1)导入 pygame 时,出现错误。

>>> import pygame
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pygame
ImportError: No module named pygame

那么,对于多个 python 安装来说,安装 pygame 的正确方法是什么?

答案1

多次安装。

python2.6 setup.py install
python3.1 setup.py install

相关内容