r/learnpython • • 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

43 comments sorted by

View all comments

Show parent comments

1

u/SharkSymphony 7d ago

Virtual environments don't manage installations of Python itself, only Python packages. We use other tools like pyenv (unfortunate naming collision!), uv, or pymanager to manage multiple installations of Python when we need them. (Or containers or VMs.)

1

u/Confident_Hyena2506 7d ago

All of those things are virtual environments, you are getting hung up on terminology.

There is a specific thing called venv yes - and many others.

On windows people have limited options tho. You missed out on "conda" as well - which is also better.

1

u/SharkSymphony 7d ago

No, one of these things is almost always what we mean when we say "virtual environment" in the Python community.

But you're right – conda is another option. I disagree that it's better, but I recognize its use in the Python data community.

1

u/Confident_Hyena2506 7d ago

It is better - the part you miss is that it's a general purpose thing and not a simple python thing. As in you can use it to setup your c++ env and other things.

On windows this is especially useful, because all the usual stuff like containers are useless on windows.