我使用以下命令在我的 Arch Linux 机器上安装了 pygame:
$ sudo pacman -S python2-pygame
我正在使用 pyenv 并且该项目的虚拟环境中的 Python 版本是 2.7.11
当我运行我的程序时
$ python smartcab/agent.py
这是我得到的:
Traceback (most recent call last):
File "smartcab/agent.py", line 2, in <module>
from environment import Agent, Environment
File "/home/alex/machine-learning/projects/smartcab/smartcab/environment.py", line 5, in <module>
from simulator import Simulator
File "/home/alex/machine-learning/projects/smartcab/smartcab/simulator.py", line 4, in <module>
import pygame
ImportError: No module named pygame
请问我该如何解决?