Updating venv docs
This commit is contained in:
parent
0f368e9a49
commit
ff81a00ad6
@ -33,7 +33,5 @@
|
||||
-->
|
||||
|
||||
* Requirement
|
||||
* git
|
||||
* python
|
||||
* pip
|
||||
* [git](pages/requirement/git.md)
|
||||
* [venv](pages/requirement/venv.md)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
## Requirement
|
||||
|
||||
You need a `git`, `python`, `pip`, and [venv](pages/requirement/venv.md) before using CostaPy.
|
||||
You need a [git](pages/requirement/git.md), `python`, `pip`, and [venv](pages/requirement/venv.md) before using CostaPy.
|
||||
|
||||
Install them using the following commands on your `Debian` or `Ubuntu` system.
|
||||
|
||||
|
||||
3
pages/requirement/git.md
Normal file
3
pages/requirement/git.md
Normal file
@ -0,0 +1,3 @@
|
||||
# git
|
||||
|
||||
Work in progress
|
||||
@ -1,6 +1,8 @@
|
||||
# venv
|
||||
|
||||
- Why must `venv`?
|
||||
## Why must `venv`?
|
||||
|
||||
Modern Debian & Ubuntu follow `PEP 668`. This is why you see errors like `error: externally-managed-environment`. It literally means "This Python environment is managed by the OS. Don’t touch it with pip.".
|
||||
|
||||
`venv` is a module in Python that provides support for creating lightweight, isolated Python environments, known as virtual environments. Each virtual environment has its own installation directories and can have its own versions of Python packages, independent of the system-wide Python environment.
|
||||
|
||||
@ -10,6 +12,10 @@
|
||||
|
||||
When a project is no longer needed, deleting its virtual environment is straightforward and does not affect other projects or the system's Python environment.
|
||||
|
||||
- Why I add `venv` on my `gitignore`?
|
||||
## How it works?
|
||||
|
||||
When you run `python3 -m venv your_venv_directory_name`, Python creates a directory for “A mini Python install just for this project”. When you activate it with `source .venv/bin/activate`, your shell is told "When I type `python` or `pip`, use the ones inside `.venv`", Nothing else changes. So, when you type `pip install requests`, it installs only inside `.venv`. Then, you can deactivate venv with `deactivate` command.
|
||||
|
||||
## Why I add `venv` on my `gitignore`?
|
||||
|
||||
Committing `venv` to Git is gross. Virtual environments can contain thousands of files and their size can be in gigabytes. Committing them to Git can overload and clutter your source code repo with unnecessary files and cause confusion for anyone trying to clone and run the source code on their machine.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user