|
|
Subscribe / Log in / New account

Python virtual environments

Python virtual environments

Posted Jun 14, 2018 13:41 UTC (Thu) by cortana (subscriber, #24596)
In reply to: Python virtual environments by gdamjan
Parent article: Python virtual environments

Good grief, why on earth did they bother with venv and *shudder* virtualenv if it was that simple all along!


to post comments

Python virtual environments

Posted Jun 15, 2018 18:27 UTC (Fri) by k8to (guest, #15413) [Link] (2 responses)

venv/virtualenv are essentially just a crappy hack that exploited a behavior of the default python logic to find its library location.

Essentially it's an extremely overwrought way to say something like export PYTHON_LIB=/a/path

Adding onto this, its magical nature and overuse means that you can get extremely hard to debug problems when you create a virtualenv and install a tool that itself uses a virtualenv.

It's just brain damage, and it's high time that python simplified this stuff.

Python virtual environments

Posted Jun 18, 2018 21:32 UTC (Mon) by stevedower (guest, #116614) [Link] (1 responses)

Yep, it really is this simple. I too do it all the time, which is why I was confident enough to stand up and say it should just be automatic. The only challenge is agreeing on "what magic marker means we should put a certain directory in sys.path", and I think we'll be okay there (likely __pypackages__ - if that directory exists, you can import everything from it and pip will default to installing into it).

Python virtual environments

Posted Jun 19, 2018 15:57 UTC (Tue) by k8to (guest, #15413) [Link]

In my projects I typically just do manipulate sys.path to point to an included directory during startup of my main python file, which I find vastly simpler than all the package managers and environment variables in the world.

However, that's obviously not sufficient for some problems, so I salute modernizing sys.path setup.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds