Hi Sara and Rui …. in following your latest posts on using cameras in RPi (i.e. USB cameras, OpenVC, etc), you recommend creating a virtual environment first (you may have also done so in using Flask, but maybe it was someone else). I understand that things can get messy if one pip’s and apt’s packages until the “cows come home”, but having multiple environments gets to be a nuisance (e.g. one for video, webservers, radios, sensors, etc …). Have you had problems, in your experience, that virtual env’s solve? That would be helpful to justify using them.
I notice that you have a separate non-virtual-env method using apt (since it doesn’t work in virtual env’s) … why use one versus the other? Thanks! — JoeM
Hello Joe! In the last couple of months, I think Python packages started being designed to work better under virtual environments.
For example, if you try to install MediaPipe globally or without a virtual environment, it will not install correctly on the Raspberry Pi.
OpenCV works correctly with the apt command, but it installs an older package (Virtual environment installs a newer version)…
I honestly don’t know the real explanation, but I think if you plan to install the packages (without compiling it from scratch) you must use Python Virtual Environments
Thank you Rui !! … excellent answer and help! I will start using these “virtual habitats” for projects :–) … so, should one have just 1 large Virtual Env (like the /projects one you described in your tutorial), or should each major category have its own (e.g. webservers, cameras, radio-related projects, etc), or should each major project have one (e.g. alarmSensorWebserver project, remoteCamera project, clientXproject, etc) ??