Python Virtual Environment Usage on Raspberry Pi
published October 24, 2023, last edited March 08, 2024
43
Intermediate
Project guide
TLDR
- NO =
sudo pip
- NEVER RUN PIP WITH SUDO
- YES =
sudo apt
orsudo apt-get
- installing Debian packages is OK
- many Python modules are available as Debian packages
- YES =
sudo /absolute/path/to/venv/bin/python foo.py
- invoking Python with sudo is OK
- this is required in some situations to access underlying hardware (ex: neopixel)
- PEP 668
- xkcd 1987
Page last edited March 08, 2024
Text editor powered bytinymce.