Hacker News new | past | comments | ask | show | jobs | submit login
Virtualenv is an antipattern (inburke.com)
11 points by kevinburke on May 9, 2012 | hide | past | favorite | 9 comments



I agree. The first 20 or so times I heard about virtualenv my thought was, "this must be for the people stuck using windoze or OSX that can't just sudo apt-get install python-whatever." Now that my Ubuntu 10.04 install is getting a little outdated I have picked up virtualenv use, so as to have a nice container for more up-to-date python packages. It isn't for beginners though.

Also, I almost dismissed this whole blog post as just whining, until I saw the "How to draw an owl" graphic. Nice touch.


>I agree. The first 20 or so times I heard about virtualenv my thought was, "this must be for the people stuck using windoze or OSX that can't just sudo apt-get install python-whatever."

Nothing to do with OS X or Windows specifically. Actually Linux is well known for having problems if you replace the system Python, because a lot of tools depend on it (Debian especially). And apt-get doesn't get you automated multiple isolated environments with all your dependencies...


Well I think you've just said the same thing as your parent. He says he used to think apt-get made virtualenv unnecessary, now he doesn't.


Anything that can recreate local independant context is golden to me.


He keeps using this word "anti-pattern". I don't think it means what he thinks it means.

What the rant meant to say is "virtualenv can be confusing for beginners, we should stop suggesting it to them".

But does this even happen? I've personally never seen an article, post, manual etc that advocates virtualenv to Python beginners. To people that already know some Python and want to write a web app, yes, but I don't think I ever saw a "Starting out learning Python? Then use virtualenv" advice.

Perhaps one can find one or two texts on the net that do give it. I doubt one can find five.


Off the top of my head the Heroku quickstart, the pip installer, and the Django quickstart all tell you you should use it.


Off the top of my comment above, I said:

"To people that already know some Python and want to write a web app, yes, but I don't think I ever saw a "Starting out learning Python? Then use virtualenv" advice."

People tackling Django and Heroku are not Python beginners. They have to at least know the basics first...

Even pip is not something for a first-time Python use to use. Before he gets to use third-party modules he has to learn the basics of the language, syntax etc. Have you seen any introductory Python book (Learning Python, etc) starting with the installation of third party stuff via Pip?


Hae you been in #django? Lots of them are beginners not just to Django, but to Python too,


Well, they should not start with Django then. First learn your tuples and lists et all.

But if they have to start to learn Python with Django (or just want to), then virtualenv is the list of their worries.

They will have to deal with lots more stuff to build and deploy their webapp for it to matter.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: