by hal9000-tng · 6y ago · 0 comments
> [complex commands to set up a venv follows]
"All you have to do is... recompile your kernel... check your version dependencies... maybe do that once or twice. It's so simple, I don't know why everyone doesn't do it!"
Ubergeek.tv's classic "Switch to Linux" spoof ad of 2001:
python -m venv myvenv
myvenv/bin/pip install ...
works just as well, i just needed a concrete path to talk about in the rest of the text.Compared to "just pip" it's one whole extra line, so I don't think it's amazingly godawful at all.
For newbies, writing one line is impossible.
Which the author explicitly said does not exist for the use case he is discussing:
"the environment our Python program runs in doesn't really have a home directory"
You can certainly put a directory wherever you like and put the code there. In fact, that's exactly what the author did, as he describes in the article.
What you can't do is just magically have that directory be the "home" directory of a user and have the $HOME environment variable always point to it. You might be able to set things up to do that in principle, but it might not be worth the trouble as compared to other solutions. In fact, that's pretty much the position the author takes in the article for his use case.
Most Python developers have virtualenv creation done for them via their IDE or scripts that vastly simplify the process so that you don't need to bother with the details in the OP.
development != deployment.