Why do we create virtual environments?

May 12, 2018, 11:25 p.m.


Being a new developer with no industry experience, I find myself asking, "why?" very often. I tend to have issues following instructions when I don't understand why I am doing that particular step.

I have been learning and using Django and I ran into a question that I avoided at first, but it bugged me. I couldn't really understand why we had to create virtual environments for projects. I had questions: Why do we have to create the virtual environments? Why is it bad practice not to? Do we have to create a new virtual environment each time? How do I deactivate it?

Anyway, I finally got the time to do some Googling. I found a neat video on Youtube that answers my questions. The video explains the multiple packages and versions problem quite well using examples.