创建conda环境:
conda create --name gymlab python=3.5(根据自己的python版本定,3.5以上不兼容gym)
安装gym所需依赖:
sudo apt-get install -y python-numpy python-dev cmake zlib1g-dev xvfb libav-tools xorg-dev python-opengl libboost-all-dev libsdl2-dev swig
进入github上openai的repository,clone gym:
git clone https://github.com/openai/gym.git
cd gym
pip install -e '.[all]'
安装过程中出现:
Cannot uninstall 'Cython'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
执行:pip --default-timeout=100 install --ignore-install Cython
之后重新执行:
pip install -e '.[all]'
问题解决。