Hacker Newsnew | comments | show | ask | jobs | submit login

No thank you. I will continue using my "magic" that has caused me 0 problems over the past couple of years running python scripts thousands of times. If you hate automation so much, feel free to keep typing "env/bin/python" every time you execute something, but for 99.99% of us, virtualenv works perfectly fine for everyday use.



> for 99.99% of us, virtualenv works perfectly fine for everyday use.

Depends on what you are running and from where. The usual virtualenv activate (although I recommend virtualenvwrapper's workon) works fine for a human interacting with a terminal.

But it is annoying for bash scripts, extremely annoying for Fabric scripts where each command is run in a separate SSH session, and sometimes completely impossible when a server needs to spawn a python subprocess. Used this exact method to solve issues with nginx+uwsgi web server deployments a few weeks ago.

Using the full path to the virtualenv's python works in any context, even when you can't set environment variables or run two commands.

-----


Using Fabric's

  with prefix('source venv/bin/activate'):
.. is not annoying in the slightest (to me).

-----


Yeah, just put the venv's bin dir at the head of the script's PATH.

-----


FWIW I know "doing it wrong" was a bit inflammatory, and generates this kind of reaction from people who think I'm determined to take their easy workflow away.

I've got plans to address this sort of complaint, to let folks who like the current behavior to keep working the way they always have and enable those like me who want a "keep all the state in a subshell" behavior to get my proposed workflow.

As one commenter points out, those plans haven't moved forward since mid 2012. I don't consider the issue "dropped" though. I'll get around to it.

-----


> for 99.99% of us,

Really? Most of the time when people say that they mean "for 1 (me) of us,"

Are you sure that isn't what you mean?

-----


By virtue of the internet I have access to information on how other people in the Python community use the various tools provided by it. Thus I am able to talk in bigger scope than just merely myself. You should give the internet a try. Sometimes people talk about the tools they use (like the post I replied to).

-----


Funnily enough, whenever virtualenv and virtualenvwrapper cause problems for exactly the reasons stated in the article I do give the internet a try.

Whenever I stumble across a new problem and google for it there is a huge wealth of information about what's causing it and what the workarounds are. That's great news for me, but not so great for your bullshit 99.99% figure. A rather large number of people have run into the same problems, a huge number if you assume that most of them don't post about it since someone already has.

Also funny is that there are now decades of experience with shell tools and programs, much more than there is with python, nevermind virtualenv. Perhaps they have best practices for a reason?

-----


I think you're overestimating. virtualenv works "fine" for some but it has warts when interacting with the scientific toolkit. IPython gets annoying, for example.

-----




Applications are open for YC Winter 2016

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: