What is virtual environment in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is virtual environment in python

17th Mar 2021, 7:41 AM
Sufia Hashmi
Sufia Hashmi - avatar
3 Answers
+ 1
If you have python 3.8 on your computer you want to create games with pygame but pygame package is available only for python 3.5. Instead of uninstalling 3.8 and installing 3.5. You can install python 3.5 into a different folder called envs. You also can have different environments of Python 3.8. Lets say you use one for machine learning which have tensorflow etc. And you have another another environment which have pyPdf2 where you manipulate Pdf files. Python is easy to code but because of package dependency structure sometimes you have to install 100 different python environments to be able to use 100 different packages. It is an huge waste of memory. They have to solve this
17th Mar 2021, 8:26 AM
deleted
+ 1
Its a place you can run your code in like a sandbox enviornment. People use virtual python enviornments when making large projects, or using different versions of python.
17th Mar 2021, 7:53 AM
Slick
Slick - avatar
0
deleted, Slick there are any environment manager to do that? Anaconda, pyenv, virtualenv... What's is the best? Also I see have a "requirements.txt" file is a convention. Which is the propouse?
4th Apr 2021, 3:14 AM
David Ordás
David Ordás - avatar