Setting Up Environment
Before writing any RAG code, you need a clean Python environment. This chapter walks you through creating a virtual environment, activating it, and installing the essential libraries.
Why a Virtual Environment?
A virtual environment keeps your project dependencies isolated. Different projects may need different versions of the same library – virtual environments prevent conflicts.
Step 1: Create a Virtual Environment
python -m venv rag-envStep 2: Activate the Environment
Windows:
rag-envScriptsactivateMac / Linux:source rag-env/bin/activateYou will see the environment name in your terminal prompt.Step 3: Install Core Libraries
pip install langchain chromadb sentence-transformers streamlit pypdfWe will install additional libraries as needed in later chapters.Two Minute Drill
- Use
python -m venv env_nameto create a virtual environment. - Activate with
source env/bin/activate(Mac/Linux) orenvScriptsactivate(Windows). - Install libraries with
pip install. - Always work inside a virtual environment to avoid dependency conflicts.
Need more clarification?
Drop us an email at career@quipoinfotech.com
