r/learnpython • u/Artistic-Army4423 • 8d ago
Virtual Environment and Python
I have started learning python and decided to use pycharm as an editor. I want to know anything which will help me in this journey.
My main question is => I don't get "virtual environment" thing with python. I cloned a repo and opened it in pycharm, it says "No python interpreter configured for <repo-name>" and then suggested to create virtual environment.
I want to hear things from experience devs.
thank you.
4
Upvotes
1
u/unnamed_one1 8d ago
Disclaimer: I'm not an experienced dev, just a hobbyist, but I hope it helps anyway.
Think of a virtual environment as a sandbox with its own versions of python and packages.
When you install python on your computer, think of it as the global environment. Every package you install with pip3 will be available in this global environment.
But you can create additional virtual environments, which let you use different python and package versions.
It's good practice to use a virtual environment per project, because it allows you to make sure the python version and the versions of your packages for the project are exactly what your project needs.