Questions: simon.hirlaender@plus.ac.at or ida.sarl.plus@gmail.com.
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.
- Prerequisites
- Step 1: Install Python 3.11.9 or Higher
- Step 2: Clone the Repository
- Step 3: Create a Virtual Environment
- Step 4: Activate the Virtual Environment
- Step 5: Install Dependencies
- Step 6: Verify the Installation
- Step 7: Deactivate the Virtual Environment
- Troubleshooting
- Further Assistance
- Contributing and Error Reporting
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
-
Download the Python Installer:
- Visit the Python Downloads for Windows page.
- Download the latest Python 3.11.x installer (e.g.,
python-3.11.9-amd64.exe
).
-
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.
- Locate the downloaded
-
Verify the Installation:
- Open Command Prompt (
Win + R
, typecmd
, and pressEnter
). - Run:
You should see:
python --version
Python 3.11.9
- Open Command Prompt (
-
Download the Python Installer:
- Visit the Python Downloads for macOS page.
- Download the latest Python 3.11.x installer (e.g.,
python-3.11.9-macosx10.9.pkg
).
-
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.
- Locate the downloaded
-
Verify the Installation:
- Open Terminal (
Command + Space
, typeTerminal
, and pressEnter
). - Run:
You should see:
python3 --version
Python 3.11.9
- Open Terminal (
Clone the RL Bootcamp Tutorial repository to your local machine using Git.
-
Open Terminal or Command Prompt.
-
Run the Clone Command:
git clone https://github.com/SARL-PLUS/RL_bootcamp_2024_tutorial.git
-
Navigate to the Project Directory:
cd RL_bootcamp_2024_tutorial
Creating a virtual environment isolates your project's dependencies from other Python projects on your system.
-
Run the Following Command:
python3 -m venv venv
- Explanation:
python3
: Specifies the Python interpreter. Usepython
ifpython3
is not recognized.-m venv
: Uses thevenv
module to create a virtual environment.venv
: The name of the virtual environment directory. You can name it differently if preferred.
- Explanation:
Before installing dependencies, activate the virtual environment.
-
Run the Activation Script:
venv\Scripts\activate
-
Confirmation:
- Your command prompt should now be prefixed with
(venv)
indicating that the virtual environment is active.(venv) C:\Path\To\RL_bootcamp_2024_tutorial>
- Your command prompt should now be prefixed with
-
Run the Activation Script:
source venv/bin/activate
-
Confirmation:
- Your terminal prompt should now be prefixed with
(venv)
indicating that the virtual environment is active.(venv) your-mac:RL_bootcamp_2024_tutorial user$
- Your terminal prompt should now be prefixed with
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.
- Ensure that the
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
...
After you're done working with the project, you can deactivate the virtual environment.
deactivate
- Your command prompt will return to its usual state without the
(venv)
prefix.
-
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
withpip
. Instead, use a virtual environment. - If necessary, add the
--user
flag:pip install --user -r requirements.txt
- Avoid using
-
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.
- If you receive an execution policy error, open PowerShell as an administrator and run:
-
-
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:
Replace
python3.11 -m venv venv
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.
- Official Python Documentation: https://docs.python.org/3/
- Git Documentation: https://git-scm.com/doc
- Virtual Environments (
venv
): https://docs.python.org/3/library/venv.html - Pip Documentation: https://pip.pypa.io/en/stable/
- Community Support:
We appreciate your interest in improving the RL Bootcamp Tutorial. Your contributions and feedback are valuable to us. If you encounter any issues, have suggestions, or wish to contribute to the project, please follow the guidelines below.
-
GitHub Issues:
- Navigate to the GitHub Issues page of the repository.
- Click on "New Issue" and provide a descriptive title and detailed information about the error.
- Include steps to reproduce the issue, screenshots, and any relevant logs.
-
Email Support:
- You can also report errors directly via email:
- Please include detailed information about the issue and any supporting documents.
-
Fork the Repository:
- Click on the "Fork" button on the repository's GitHub page to create a copy under your account.
-
Create a Feature Branch:
- Clone your forked repository to your local machine.
git clone https://github.com/your-username/RL_bootcamp_2024_tutorial.git
- Navigate to the project directory:
cd RL_bootcamp_2024_tutorial
- Create a new branch for your feature or bug fix.
git checkout -b feature/your-feature-name
- Clone your forked repository to your local machine.
-
Make Your Changes:
- Implement your changes or additions.
- Ensure your code follows the project's coding standards and includes appropriate documentation.
-
Commit and Push:
- Commit your changes with a descriptive message.
git commit -m "Add feature XYZ"
- Push the branch to your forked repository.
git push origin feature/your-feature-name
- Commit your changes with a descriptive message.
-
Submit a Pull Request:
- Navigate to the original repository and click on "New Pull Request".
- Select your branch and provide a detailed description of your changes.
-
Code Review:
- Your pull request will be reviewed by the maintainers.
- Be prepared to make revisions based on feedback.
- Please adhere to the project's Code of Conduct when interacting with the community.
- Be respectful, inclusive, and considerate in all communications.
Feel free to reach out if you have any questions or need further assistance!