Re:Show HN: Vex, a new way to run things in Python's virtual...
by acjohnson55 on Friday July 04, 2014 @01:49AM
(#7987511)
Ha. I always thought something was unnecessarily awkward about virtualenv, but I couldn't quite put my finger on it. Virtualenvwrapper was an improvement in many ways, but its lack of portability could be a pain. Reading the docs, Vex makes perfect sense. We should use virtualenv basically the same way we sudo. It's kind of amazing it took this long for someone to do it. Thanks!
[ Parent
| on HN ]
Re:Show HN: Vex, a new way to run things in Python's virtual...
by ProblemFactory on Friday July 04, 2014 @02:01AM
(#7987539)
Vex seems very convenient, but it is also possible to avoid the "magic" with just standard virtualenv.
If you provide the full path to the python binary in the virtualenv, it executes with the virtualenv loaded:
/home/acjohnson/virtualenvs/foo/bin/python myscript.py
This is useful for crontabs, system service config, etc. which don't load a regular user's bash setup files.
Re:Show HN: Vex, a new way to run things in Python's virtual...
by shuzchen on Friday July 04, 2014 @03:24AM
(#7987734)
Similarly, anything you've installed in that virtualenv that installs itself in a bin folder (pip, mercurial, django-admin.py, etc) will be in that bin folder, and calling them from that directory will execute them in the context of that virtualenv as well.
Re:Show HN: Vex, a new way to run things in Python's virtual...
by sashahart on Friday July 04, 2014 @04:10AM
(#7987824)
Fully agreed, and the README for vex suggests this if you are worried about overhead from the wrapper especially for non-interactive purposes where you are repeatedly incurring python startup.