Why should you use Python virtual environments ?

Onur Kocyigit
2 min readJan 8, 2023

You are working on different projects simultaneously, than you should learn more about virtual environments. Virtual environments create different spaces for each project in order to work with specific packages. But why should you use that? What are the advantages of using virtual environments?

Photo by Juanjo Jaramillo on Unsplash

1-Working with different versions of a package

Assume that you are working on a project and you want to test it with different versions of a specific package. You can do it easily with virtual environments. You create different environments with different versions of a package each, than you can run your code in these enviroments seperately.

2-Multiple environments for different projects

You are a software engineer or a professional programmer and you have lots of projects to work on. Then I think you want to keep it clean and organized. In order to do that you should use virtual environments. You can create every project with its own environment and run it. With that you can keep track of different packages easily.

Photo by Arnold Francisca on Unsplash

3-Easy to use

It is really easy to use. You can create and delete environments via your command prompt. You can install and deinstall the packages with couple of commands.

I would be happy to see your constructive comments and questions below.

--

--

Onur Kocyigit

Programming | Electronics | Artificial Inteligence | Finance | Fitness&Health