运行import gym
没问题,但是
env = gym.make('MsPacman-v0')
报错,
安装依赖的包:
sudo apt-get install -y python-numpy python-dev cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig libglfw3-dev
安装libav-tools报错Package has no installation candidate,用:
# apt-get update # apt-get upgrade # apt-get install <packagename>
其中libav-tools
,libglfw3-dev
安装不上的话,用这个替代:
sudo apt-get install ffmpeg sudo apt-get install libglfw3-dev
还有安装Pillow
:
pip install Pillow
最后安装:
pip install gym[atari]