• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

need for a virtual environment

Q&A Forum › Category: Raspberry Pi › need for a virtual environment
0 Vote Up Vote Down
Joe Margevicius asked 1 year ago

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

Question Tags: Virtual Environments
2 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 1 year ago

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

0 Vote Up Vote Down
Joe Margevicius answered 1 year ago

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) ??

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.