python: package management

This commit is contained in:
thomasabishop 2023-08-18 19:35:50 +01:00
parent 933f1baa4a
commit 2d0d88dcf2

View file

@ -14,14 +14,24 @@ To make use of virtual environments in `pip` you have to create the virtual envi
```
python3 -m venv venv
source venv3/bin/activate
pip [library_name]
```
This will create a `venv` directory in your project that will manage the handling of modules.
> This is especially important in ArchLinux since without a virtual environment it will ask you to install packages with `pacman` which is annoying for local packages.
You then activate the environment with:
```
source venv3/bin/activate
```
Now you can install packages:
```
pip [library_name]
```
## requirements.txt
The `requirements.txt` file is similar to the `package.json` in Node projects.