This article is now published on my website: Prefer Subshells for Context.
-
-
Save datagrok/2199506 to your computer and use it in GitHub Desktop.
All I can say is +1
great article. It is exactly what people need when python is integrated to other technologies (like java). python code probably is called with not terminal in the middle. This article solved my problem.
forget pip - pip3
use conda https://conda.io/docs/_downloads/conda-cheatsheet.pdf
This is great. I would just note that there is no need to hard code the path of the virtualenv in shell and batch scripts. It can and should be relative.
Please also look at vrun
[1] which is super lightweight and simply activates a virtualenv for the duration of a command. You run something like env/bin/vrun <cmd>
and it is executed with all of the virtualenv scripts etc on the path. This is similar to vex
but with fewer assumptions and should be mentioned in the same conversation.
Helpful! Thank you!!
404 on the link 👎
still 404
I've been using conda for a while and the same problem was bothering me.
Conda has an virtualenv's style activate and it was very annoying to use the envs on a non-console application (IDE).
So I created exec-wrappers to be able to create wrappers ready to use with minimum overhead.
It also happens to create wrappers for virtualenv. So if someone is interested, please take a look.