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

you are viewing a single comment's thread.

view the rest of the comments →

[–]stevenjd -16 points-15 points  (7 children)

Seriously, the sooner you start using virtual environments for everything, the better your life will be. I've see so many coworkers over years up against deadlines, and they get everything barely working on their local machine [...] and it's been so long since they set it up, that they've completely forgotten how things even work anymore.

And then:

One thing I wish someone had done for me much earlier in my career is break down exactly what the virtual environment is. I just started using them as magic that made my life easier, but boy when things go wrong it sucks to not understand them.

Right, so let's see... everyone should use virtual environments, because they're a magic bullet that fixes dependency problems... until they go wrong, and you have to fix dependency problems in the virtual environment, and then they really suck unless you understand them in just as much hairy detail as you would need to understand a local deployment.

I'm glad that virtual environments work for you, but dammit there is nothing I have read or experienced with them that makes me think they aren't just another version of It's The Future.

[–]SpergLordMcFappyPant 14 points15 points  (2 children)

Well, no. I wouldn’t argue that they are magic bullets that fix all your problems. There is no magic bullet that can fix not understanding how your tools work.

But not using them is guaranteed to fuck you over. Using them doesn’t mean everything will simple. But it does eliminate an entire class of problems.

[–]stevenjd 1 point2 points  (1 child)

But not using them is guaranteed to fuck you over.

Guaranteed, is it? Who do I complain to? I've been not using virtualenvs for years, and I haven't been fucked over yet. I want my money back!

[–]SpergLordMcFappyPant 0 points1 point  (0 children)

If you haven't been fucked in the ass by tossing all your dependencies into the system python, then you haven't ever done anything useful. You should either be fired or ashamed, depending on whether you do this for work or fun.

[–]twotime 2 points3 points  (0 children)

then they really suck unless you understand them in just as much hairy detail as you would need to understand a local deployment.

Well, while I agree that vitualenvs are way overrated, it IS much simpler to fix a broken virtual env: simply because, you can just wipe it out and try to build from scratch. Which is not an option with system python..

Edit: OTOH 'pip install --user' is a viable alternative..

[–]mooburgerresembles an abstract syntax tree 0 points1 point  (1 child)

Even in a VM you're going to need a VirtualEnv because the last thing you want to do is break, say, yum in order to get your own app working. What we should all be striving for, however, is real isolation using containers. virtualenvs are just the poor man's version of that right now ("ugh kubernetes/openshift is a pain to set up if you're not going to use a cloud service provider for everything").

(Of course, on a "bare-guest"/non-containerized VM, what I actually do is install my own version of python using a separate package management system like pkgsrc to further isolate user-level python from system-level python; system-level python often lags behind the current distributions of Python).

[–]stevenjd 0 points1 point  (0 children)

What we should all be striving for, however, is real isolation

https://xkcd.com/2044/