Installing Mujoco py on Linux - reinforcement-learning-kr/pg_travel GitHub Wiki
Test environment
OS: Ubuntu 16.04 / x86_64
python version: 3.6
pytorch : 0.4.0
MuJoCo version: 150
Installation manual for Linux
1. Install required packages
sudo apt install -y build-essential autoconf libtool pkg-config python-opengl python-pil \
python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 \
libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl \
libgle3 python-dev libgl1-mesa-dev libgl1-mesa-glx libosmesa6-dev python3-scipy libglew-dev patchelf
2. Make and activate virtual environment
replace pgtravel
with your favor name.
$ virtualenv pgtravel -p python3.6
$ source pgtravel/bin/activate
3. Clone OpenAI Gym repository and install it.
git clone https://github.com/openai/gym.git
cd gym
pip install -e .
4. Install Mujoco
- Download MuJoCo-pro 150 version. download
- Unzip
mjpro150_linux.zip
file to$HOME/.mujoco/mjpro150/
- successful structure is below:
- Setup Environment Variable
- Write below command in
~/.bashrc
file -
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.mujoco/mjpro150/bin
- Write below command in
- Get 30-day Trial license
- Obtain a computer id using the getid_linux program.
- Obtain the Mujoco license with the computer id.
- After successful submission, you get an e-mail from 'Roboti LLC Licensing' containing the trial license file
mjkey.txt
. Be careful not to leak.- Submit result
- E-mail from 'Roboti LLC Licensing'
- Download
mjkey.txt
from the email and move it to~/.mujoco/
- [Optional] Test Activation Key
-
$ cp mjkey.txt ~/.mujoco/mjpro150/bin/ cd $HOME/.mujoco/mjpro150/bin ./simulate
-
5. Install mujoco_py
$ git clone https://github.com/openai/mujoco-py.git
$ cd mujoco-py
$ python3 setup.py install
[Optional] Test mujoco-py
$ python3
>> import mujoco_py
>> import gym
>> env = gym.make('Hopper-v2') # or 'Humanoid-v2'
>> env.render()
- If
CompileError
aboutgcc
orcython
raises, then, try to re-installmujoco-py
.
6. Install pytorch
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.0-cp36-cp36m-linux_x86_64.whl
pip3 install torchvision
7. Clone pg_travel repository and install the prerequisite
$ git clone https://github.com/reinforcement-learning-kr/pg_travel
$ pip install tensorboardX
$ pip install tensorflow
TMI (Too Much Information)
If you are windows user and want to make shared folder in virtualbox
It's helpful references for me to make shared folder in virtualbox.
- https://askubuntu.com/questions/161759/how-to-access-a-shared-folder-in-virtualbox
- https://extrememanual.net/10063
For shared folder permission
$ sudo gpasswd -a [user_name] vboxsf