This repository provides step-by-step instructions for setting up the environment required to run Deep Deterministic Policy Gradient (DDPG) algorithms using the Panda robot simulation provided by panda-gym and stable-baselines3. This setup is ideal for researchers and developers interested in reinforcement learning with robotic manipulators.
Ensure you have administrative privileges to install software on your system.
- Install Windows C++ Build Tools:
- Download and install the required tools.
- Issues related to the installation of
panda-gymoften stem from missing or improperly installed C++ Build Tools.
- Use Anaconda PowerShell Prompt as your terminal for running commands.
If you haven't already, install Miniconda or Anaconda. Miniconda is recommended for a lightweight installation.
- Download Miniconda or Anaconda:
- Visit the Miniconda Installation Page.
- Choose the installer for your operating system (macOS, Windows, or Linux).
Conda allows you to create isolated environments with specific dependencies, preventing conflicts between projects.
-
Create the environment:
conda create --name ddpg_panda_env python=3.9
- Explanation:
conda create: Command to create a new environment.--name ddpg_panda_env: Names the environmentddpg_panda_env.python=3.9: Specifies Python version 3.9.
- Explanation:
-
Note: Both
panda-gymandstable-baselines3require Python 3.9 to run correctly.
Activate the newly created environment to ensure all packages are installed within it.
-
Activate the environment:
conda activate ddpg_panda_env
- Verification:
- Your terminal prompt should now display
(ddpg_panda_env)indicating the environment is active.
- Your terminal prompt should now display
- Verification:
-
Deactivate when done:
conda deactivate
With the environment activated, install the necessary packages using pip.
-
Install packages:
pip install gymnasium # Simulated environments using PyBullet as the physics engine pip install panda-gym # Panda robot arm simulation with reinforcement learning interface pip install stable-baselines3 # Reinforcement Learning algorithms (e.g., DDPG, SAC) pip install sb3_contrib # Additional tools and algorithms for stable-baselines3 pip install opencv-python pip install opencv-python-headless pip install gym-robotics
- Package Descriptions:
- gymnasium: A toolkit for developing and comparing reinforcement learning algorithms.
- panda-gym: Simulated environments for the Franka Emika Panda robot.
- stable-baselines3: Set of reliable implementations of RL algorithms in PyTorch.
- sb3_contrib: Community contributions to stable-baselines3.
- Package Descriptions:
Ensure that all packages are correctly installed.
-
List installed packages:
conda list
-
Verification:
- Check that
gymnasium,panda-gym,stable-baselines3, andsb3_contribare listed with their respective versions.
- Check that
If your IDE, such as Visual Studio Code, is showing issues even after all packages and dependencies have been installed, ensure that the correct Python interpreter has been selected. This can be done by navigating to the Command Palette, selecting "Python: Select Interpreter", and choosing the Python interpreter associated with your created environment.
- Steps to Select the Correct Interpreter:
- Open Visual Studio Code.
- Press
Ctrl + Shift + P(orCmd + Shift + Pon macOS) to open the Command Palette. - Search for and select "Python: Select Interpreter".
- From the list, choose the interpreter that corresponds to your environment (e.g.,
ddpg_panda_env).
-
Panda-Gym Documentation: Panda-Gym Docs
- Explore different environments, customization options, and usage examples.
-
Stable-Baselines3 DDPG Documentation: Stable-Baselines3 DDPG
- Learn about the DDPG algorithm implementation, parameters, and best practices.



