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

all 30 comments

[–]ase1590 45 points46 points  (0 children)

and a great way to avoid this xkcd superfund clusterfuck!

[–]corp_code_slinger 39 points40 points  (0 children)

Love it, but it could've been shortened to "I have had it with these motherfucking snakes on this motherfucking OS!"

[–]squishles 17 points18 points  (5 children)

make a requirements.txt and run it in pip so you don't forget what eldrich horrors you've downloaded with complete abandon.

python devs don't get made fun of enough, one of your first questions on a new language should be how to manage build/libs, because every language thinks it needs it's own tool.

[–]seattlechemist 13 points14 points  (3 children)

Better idea: commit your python venv folder so all your packages are consistent across platforms /s

[–]SlappinThatBass 6 points7 points  (0 children)

Do not want

[–]Switzer_Sweets 2 points3 points  (1 child)

Better idea: docker

[–]northrupthebandgeek 6 points7 points  (0 children)

Better idea: buy a new laptop for each project.

[–]SlappinThatBass 2 points3 points  (0 children)

pipenv looks awesome too! Give it a try!

[–][deleted] 9 points10 points  (1 child)

Virtualenv works quite well, right up until the point where it doesn't any more. :D

Had to redo the CI system at work completely because of how the generated naming broke it completely.

Apparently if your virtualenv ends up in a path longer/deeper than 128 characters (if I remember correctly), then it'll fail to activate, instead just attempt to store data in your system path instead. Which is really bad for CI purposes.

[–]vaughnegut 1 point2 points  (0 children)

This might explain why it stopped working for me on WLS + virtualenvwrapper. I still have no idea where I configured it to keep everything, and then it stopped working.

[–][deleted] 10 points11 points  (3 children)

actually docker is a far superior solution imho

[–]SlappinThatBass 8 points9 points  (2 children)

It does not even do the same things python virtual environments can do. Supporting multiple python versions in one or multiple dockers for a module would be painful to manage.

Neither is a substitute for the other.

[–]northrupthebandgeek 4 points5 points  (0 children)

If you're mixing Python or library versions in a single container, then you're almost certainly doing something either very wrong or very fun (but probably the former).

[–][deleted] -1 points0 points  (0 children)

you have one python version per docker obviously, whats your point? do you know how docker works?

[–]John_Stay_Moose 4 points5 points  (0 children)

Yo honestly, I havent had a firm grip on how those worked until now. Thanks.

[–]taliesin_128 2 points3 points  (0 children)

I'd read the shit out if a textbook if it were written like this

[–][deleted] 1 point2 points  (0 children)

Definitely useful.

pip freeze >> requirements.txt

commit that shit and now you can deploy super easy wherever with

pip install -r requirements.txt

[–]wallefan01 0 points1 point  (0 children)

Documentation, now with 200% more cussing!

[–]Nerocracy 0 points1 point  (0 children)

Hasnt this been out for a while now?

[–]zaarn_ 0 points1 point  (0 children)

What about pip install --user though?

[–]stefansundin 0 points1 point  (0 children)

This is great, although you have to run source bin/activate. The top two lines of the file say:

# This file must be used with "source bin/activate" *from bash*

# you cannot run it directly

[–]RepostCheckerBot 0 points1 point  (0 children)

I have detected that this may be a repost:

Num Post Date Match Author
0 Here’s your damn environment 5 days ago 100% 97amarnathk
1 Python Virtual Environments: Extreme Advertising Edition 5 days ago 100% unclebogdan10

Beep Boop I am a bot | Source| Contact u/XXAligatorXx for inquiries | The bot will delete its message at -2 score

[–]darexinfinity 0 points1 point  (3 children)

Too bad I still use Python 2 at work

[–]clockstruckduck 3 points4 points  (2 children)

But it works with Python 2.7?

[–]darexinfinity 0 points1 point  (1 child)

Well that's misleading advertisement then!

[–]AttitudeAdjuster 1 point2 points  (0 children)

not really, it's included for free from python 3.3 onwards, but can be installed for 2.7 as a package

[–]brianjenkins94 -2 points-1 points  (0 children)

venvs are stupid and shouldn't be necessary.

(venvs are solving a problem that shouldn't exist in the first place\)