当前位置:   article > 正文

Ubuntu16.04LTS下搭建强化学习环境gym

ubuntu16.04lts下搭建强化学习环境gym

Ubuntu16.04LTS下搭建强化学习环境gym

1.安装Anaconda

去清华镜像下载anaconda3_4.3.0-linux-x86_64.sh,然后在终端中输入以下命令进行安装:

cd downloads
bash anaconda3_4.3.0-linux-x86_64.sh
  • 1
  • 2

2.创建虚拟环境

//gymlab是自己起的虚拟环境名称 python=x.y指定python版本
conda create --name gymlab python=3.5
  • 1
  • 2

3.安装gym

先重新打开一个终端,然后遵循以下步骤:

source activate gymlab
pip install gym[all]
  • 1
  • 2

这一步可能会出错
比如:提醒pip版本低,使用如下命令更新:

python -m pip install --upgrade pip
  • 1

继续安装,不出意外,还会报错:
Failed building wheel for mujoco-py

这个需要自行安装一下mujoco,可以参考这个方法:
Mujoco以及mujoco_py的安装
安装完成之后,重新执行:

pip install gym[all]
  • 1

保持网络畅通,等待安装完成,看到如下信息,说明安装完成。

Requirement already satisfied: mujoco-py>=1.50; extra == "all" in /home/xtq/mujoco-py (from gym[all]) (1.50.1.65)
Requirement already satisfied: PyOpenGL; extra == "all" in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from gym[all]) (3.1.0)
Requirement already satisfied: future in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from pyglet>=1.2.0->gym[all]) (0.17.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from requests>=2.0->gym[all]) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from requests>=2.0->gym[all]) (2018.8.24)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from requests>=2.0->gym[all]) (1.24)
Requirement already satisfied: idna<2.8,>=2.5 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from requests>=2.0->gym[all]) (2.7)
Requirement already satisfied: glfw>=1.4.0 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from mujoco-py>=1.50; extra == "all"->gym[all]) (1.7.0)
Requirement already satisfied: Cython>=0.27.2 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from mujoco-py>=1.50; extra == "all"->gym[all]) (0.29)
Requirement already satisfied: cffi>=1.10 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from mujoco-py>=1.50; extra == "all"->gym[all]) (1.11.5)
Requirement already satisfied: lockfile>=0.12.2 in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from mujoco-py>=1.50; extra == "all"->gym[all]) (0.12.2)
Requirement already satisfied: pycparser in /home/xtq/anaconda3/envs/gymlab/lib/python3.5/site-packages (from cffi>=1.10->mujoco-py>=1.50; extra == "all"->gym[all]) (2.19)
Installing collected packages: atari-py, box2d-py, gym
Successfully installed atari-py-0.1.6 box2d-py-2.3.5 gym-0.10.8

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/990584
推荐阅读
相关标签
  

闽ICP备14008679号