Update docs/tech_docs/Python-Virtual-Environments.md

This commit is contained in:
2024-01-09 06:57:14 +00:00
parent 1792c7fc3e
commit 9c18f4ea6f

View File

@@ -151,7 +151,7 @@ Organizing virtual environments is crucial for maintaining a clean and efficient
Create an individual virtual environment for every project to avoid dependency conflicts. Create an individual virtual environment for every project to avoid dependency conflicts.
- **Environment Location**: - **Environment Location**:
\```plaintext ```plaintext
Place the virtual environment directory inside the project's root directory. Place the virtual environment directory inside the project's root directory.
Example Structure: Example Structure:
@@ -161,7 +161,7 @@ Organizing virtual environments is crucial for maintaining a clean and efficient
├── src/ ├── src/
├── tests/ ├── tests/
└── requirements.txt └── requirements.txt
\``` ```
Ensure to exclude the environment directory from version control. Ensure to exclude the environment directory from version control.
@@ -178,9 +178,9 @@ Organizing virtual environments is crucial for maintaining a clean and efficient
- **Use `requirements.txt`**: - **Use `requirements.txt`**:
Include a `requirements.txt` file in the root directory of each project. Include a `requirements.txt` file in the root directory of each project.
\```bash ```bash
pip freeze > requirements.txt pip freeze > requirements.txt
\``` ```
## 4. Documentation ## 4. Documentation
@@ -192,12 +192,12 @@ Organizing virtual environments is crucial for maintaining a clean and efficient
- **Central Directory**: - **Central Directory**:
Alternatively, you can store all virtual environments in a central directory, e.g., `~/python_environments/`. Alternatively, you can store all virtual environments in a central directory, e.g., `~/python_environments/`.
\```plaintext ```plaintext
python_environments/ python_environments/
├── data_analyzer_env/ ├── data_analyzer_env/
├── web_app_env/ ├── web_app_env/
└── machine_learning_env/ └── machine_learning_env/
\``` ```
- **Naming Reference**: - **Naming Reference**:
Ensure the names are descriptive enough to indicate their associated project. Ensure the names are descriptive enough to indicate their associated project.