0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

公式ページ

Mujocoドキュメント
Python

前提条件

  • Ubuntu22.04 on WSL2
  • mujoco, Python mujocoパッケージはインストール済み

jupyter環境設定

  • VSCodeにJupyter拡張をインストール
  • jupyterをインストール、サーバ起動
sudo apt install jupyter-core
pip install notebook
jupyter notebook
  • Mujocoチュートリアルをダウンロード
    python tutorial

  • VSCodeでチュートリアルをオープンし、最初のセルを修正する

# コメントアウト
# !pip install mujoco

import distutils.util
import os
import subprocess
if subprocess.run('nvidia-smi').returncode:
  raise RuntimeError(
      'Cannot communicate with GPU. '
      'Make sure you are using a GPU Colab runtime. '
      'Go to the Runtime menu and select Choose runtime type.')

# 以下のjsonパスを適当なパスに変える
# ~を展開するためにはos.path.expanduser()が必要
NVIDIA_ICD_CONFIG_PATH = os.path.expanduser('~/10_nvidia.json')
if not os.path.exists(NVIDIA_ICD_CONFIG_PATH):
  with open(NVIDIA_ICD_CONFIG_PATH, 'w') as f:
    f.write("""{
    "file_format_version" : "1.0.0",
    "ICD" : {
        "library_path" : "libEGL_nvidia.so.0"
    }
}
""")

Intellisenseが効かない場合

  • site-packages/mujocoの存在するディレクトリを調べる
    find / -name mujoco*
  1. ファイル→ユーザ設定→設定を選択
  2. 検索ボックスに"python.autocomplete"と入力し、以下のsetting.jsonをクリック
    image.png
  3. python.autoComplete.extraPathsに先に調べたsite-packageのパスを追加
  4. VSCodeを再起動
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?