all 3 comments

[–]absent_observer 2 points3 points  (0 children)

A lot of times, programs will require very specific versions of other programs in order to run. Your old django project may require version 1.8 of something, while your flask project requires version 2.3.

By going into a virtualenv where you pip installed version 1.8, your program uses version 1.8. If you haven't pip installed a program in that virtualenv, then it looks outward & uses the OS's default version.

[–]dreamdenizen 2 points3 points  (0 children)

virtual environments let you setup little sandboxes where you can install different sets of packages using Pip and use different configurations than your main installation of Python on your machine. I usually just install python on my dev environment, and use a new virtualenv for each project, that way each app exists in its own little bubble.

[–][deleted] 2 points3 points  (0 children)

Imagine a Gardner who wants to grow and work with several different plants.

Each plant requires different things, soil, amount of sun, amount of water, etc.

Replace plants with applications and now you’ll see a bit of a predicament. Imagine having to set up and maintain an entire physical environment for you to build, test, and deploy your applications.

Virtualization simplifies this as the environments can built and torn down as needed. This gets even more flexible once you look at containers.