Install Dependencies
Exit
Install Dependencies
Install the four libraries your RAG app needs
💻
Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.
What you are installing
| Package | Purpose |
|---|---|
pypdf | Extract text from PDF files |
google-genai | Call the Gemini API for embeddings and generation |
numpy | Compute cosine similarity between vectors |
python-dotenv | Load your API key from a .env file |
Storing API keys directly in source code is a security risk. Anyone who reads your code sees your key. python-dotenv loads secrets from a separate .env file that you never commit to version control.
One pip install command installs all four.
Instructions
Use the pip command to install all dependencies.
- Install
pypdf,google-genai,numpy, andpython-dotenv.
Interactive Code Editor
Sign in to write and run code, track your progress, and unlock all chapters.
Sign In to Start Coding