What Is A Virtual Environment
This is my last blog post for this year and it is definitely going to be worthwhile (I know all my blog posts bangs but this is definitely going to bang more). Remember in my last blog, i wrote about myself. If you have not read it, you can read my blog posts here
Because we are in the season of sharing, For this blog, i have decided to share what i have learned so far in my transition between been a learner and an intern even though i am still learning as an intern, i have been doing a whole lot of stuffs that mimicks real life work experience, the only difference is I have mentors that i can always run to anytime that i am stuck.
As a student, i have been working with one version of python all through my learning phase, i had no issues with libraries incompatibility until i started interning for my organization.
I was given a task that requires me to use python version 3.9 and i have python version 3.10 on my machine, surely i wouldn't want to downgrade my python version entirely for this task, that was when i was advised to use a virtual environment.
Wait, i know you want to ask what is a virtual environment. I am going to tell you. According to google 'A virtual environment is a networked application that allows a user to interact with both the computing environment and the work of other users'.
It is an environment on my machine that you can make and share to other users who are working on the same project as yours without any issue of incompatibility. Just like the saying goes, "What happens in vegas stays in vegas" , whatever you do in a virtual environment stays in that virtual environment.
Me uncovering how a virtual environment works is the best thing that happened to me this month as it makes work so much easier, it eliminates dependencies issue and makes your machine less rowdy and neat if you are a neat freak like me.
Working With A Virtual Environment In Python
To create and activate a virtual environment, you just have to take the following steps
pip install virtual env
python -m activate venv
# Then you will see a (directory name) directory path to show that your virtual environment has been activated.
To read more about virtual environments, check this Documentation
I hope you enjoy reading this article as much as i enjoy writing it.
Compliments of the Season to you.
See you In 2023...