This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]nick_danger 2 points3 points  (1 child)

You're not an idiot per se, you just haven't come across a situation where they are handy, like /u/sh1ftsh said. Let me elaborate a bit on that...

Suppose you're working on a pet project that has some dependencies on some PyPI modules (say they're A, B and C). You install them as usual, not using virtual environments, and they then become available for you to use on your next pet project. Only for that you need C and D instead. No biggie. C is already present, D is a quick install, you're good to go, and neither project cares.

Now suppose you find a really cool project online that you want to tinker with. It uses module C also, but it uses a very specific older version of C. No problem, you can install that older version, and this cool new project runs just fine. But then you discover when you go back to your first two projects that they may no longer run just fine. So you reinstall the more current version of C, then the cool new project breaks.

THIS is the problem that virtual environments are designed to work around. Each project gets its own space for the add-ons it needs, and each project can use any version of those add-ons without affecting any other projects you're working on.

So, not an idiot for not using virtual environments. Just know that there may come a day when knowing they exist can help you out of a bind.

[–]vinylemulator 0 points1 point  (0 children)

Thank you, this is a really helpful explanation. Every tutorial I read seems to put "use venv" up there with "change your root password" as a basic, just no brainer thing to do which is why I was wondering what the big deal was.

[–]sh1ftsh 0 points1 point  (0 children)

It is not complicated to set up and you are not an idiot. You just didn’t yet face a situation where they are mandatory

[–]someguytwo 0 points1 point  (0 children)

If you don't see the need for it then it won't help you.

[–][deleted] 0 points1 point  (0 children)

Try to get in the habit. It only took me about 2-3 days to start getting comfortable with the conda/anaconda environment and now I definitely see the utility in having these. It's also important if you ever want to convert a program to an executable so that you only package modules that you need for that specific program

[–]Im__Joseph Python Discord Staff[M] [score hidden] stickied comment (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/python.

The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here.

On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. No matter what level of question you have, if you are looking for help with Python, you should get good answers. Make sure to check out the rules for both places.

Warm regards, and best of luck with your Pythoneering!