Create a Project Folder and Virtual Environment
Exit

Create a Project Folder and Virtual Environment

Set up an isolated Python environment for your RAG app

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

Set up your project

Always use a virtual environment for Python projects. It keeps your dependencies isolated from the rest of your system.

A virtual environment is a self-contained directory that holds a specific Python installation and packages. Activating it means any pip install command writes to that directory only.

Instructions

Run each command in your terminal.

  1. Create a folder named pdf-rag and navigate into it. Use && to chain both commands on one line.
  2. Create a virtual environment named venv. Python's built-in venv module handles this with python -m.
  3. Activate the virtual environment. The activation script lives inside venv/bin/.