Create a Project Folder and Virtual Environment
Build a RAG App — Chat with Your PDFsSet Up Your EnvironmentCreate 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.
- Create a folder named
pdf-ragand navigate into it. Use&&to chain both commands on one line. - Create a virtual environment named
venv. Python's built-invenvmodule handles this withpython -m. - Activate the virtual environment. The activation script lives inside
venv/bin/.
Interactive Code Editor
Sign in to write and run code, track your progress, and unlock all chapters.
Sign In to Start Coding