Skip to content

Latest commit

 

History

History
256 lines (177 loc) · 7.12 KB

File metadata and controls

256 lines (177 loc) · 7.12 KB

RL Bootcamp Tutorial Installation Guide

Welcome to the RL Bootcamp Tutorial! This guide will help you set up a Python environment using requirements.txt to ensure you have all the necessary dependencies to run the tutorials smoothly. Follow the steps below to get started.

Table of Contents


Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Git: Install Git
  • Python 3.11.9 or higher: Download Python
  • pip: Comes bundled with Python. Verify installation with pip --version

Step 1: Install Python 3.11.9 or Higher

On Windows

  1. Download the Python Installer:

  2. Run the Installer:

    • Locate the downloaded .exe file and double-click to run it.
    • Important: Check the box that says Add Python 3.11 to PATH.
    • Click on Install Now.
    • Follow the on-screen instructions to complete the installation.
  3. Verify the Installation:

    • Open Command Prompt (Win + R, type cmd, and press Enter).
    • Run:
      python --version
      You should see:
      Python 3.11.9
      

On macOS

  1. Download the Python Installer:

  2. Run the Installer:

    • Locate the downloaded .pkg file and double-click to run it.
    • Follow the installation prompts, agreeing to the license and selecting the installation location.
  3. Verify the Installation:

    • Open Terminal (Command + Space, type Terminal, and press Enter).
    • Run:
      python3 --version
      You should see:
      Python 3.11.9
      

Step 2: Clone the Repository

Clone the RL Bootcamp Tutorial repository to your local machine using Git.

  1. Open Terminal or Command Prompt.

  2. Run the Clone Command:

    git clone https://github.com/SARL-PLUS/RL_bootcamp_tutorial.git
  3. Navigate to the Project Directory:

    cd RL_bootcamp_tutorial

Step 3: Create a Virtual Environment

Creating a virtual environment isolates your project's dependencies from other Python projects on your system.

  1. Run the Following Command:

    python3 -m venv venv
    • Explanation:
      • python3: Specifies the Python interpreter. Use python if python3 is not recognized.
      • -m venv: Uses the venv module to create a virtual environment.
      • venv: The name of the virtual environment directory. You can name it differently if preferred.

Step 4: Activate the Virtual Environment

Before installing dependencies, activate the virtual environment.

On Windows

  1. Run the Activation Script:

    venv\Scripts\activate
  2. Confirmation:

    • Your command prompt should now be prefixed with (venv) indicating that the virtual environment is active.
      (venv) C:\Path\To\RL_bootcamp_tutorial>
      

On macOS/Linux

  1. Run the Activation Script:

    source venv/bin/activate
  2. Confirmation:

    • Your terminal prompt should now be prefixed with (venv) indicating that the virtual environment is active.
      (venv) your-mac:RL_bootcamp_tutorial user$
      

Step 5: Install Dependencies

With the virtual environment activated, install the required Python packages using the requirements.txt file.

pip install -r requirements.txt
  • Notes:
    • Ensure that the requirements.txt file is present in the project directory.
    • This command installs all packages listed in requirements.txt into the virtual environment.

Step 6: Verify the Installation

To confirm that all dependencies are installed correctly, list the installed packages.

pip list

Expected Output:

A list of installed packages along with their versions, matching those specified in requirements.txt.

Package         Version
--------------- -------
numpy           1.23.1
pandas          1.4.2
...

Troubleshooting

  • pip Not Found:

    • Ensure that the virtual environment is activated.
    • Verify that Python and pip are correctly installed and added to your system's PATH.
  • Permission Issues:

    • Avoid using sudo with pip. Instead, use a virtual environment.
    • If necessary, add the --user flag:
      pip install --user -r requirements.txt
  • Virtual Environment Activation Issues:

    • macOS/Linux:

      • Ensure that the activation script has execute permissions.
      • If you encounter a "permission denied" error, run:
        chmod +x venv/bin/activate
    • Windows:

      • If you receive an execution policy error, open PowerShell as an administrator and run:
        Set-ExecutionPolicy RemoteSigned
      • Then, try activating the virtual environment again.
  • Incompatible Python Version:

    • Ensure that the active Python interpreter is 3.11.9 or higher.
    • You can specify the Python version when creating the virtual environment:
      python3.11 -m venv venv
      Replace python3.11 with the path to the desired Python executable if necessary.
  • Missing requirements.txt:

    • Ensure that you are in the correct project directory.
    • If requirements.txt is missing, you may need to generate it or obtain it from the repository.

Further Assistance