3 ms·
I don't think you can, nor would you want to at this point. It would just be another standard (ala XKCD-927). Virtualenvs, pip, and wheels have been better th
by bb88 4y ago
I don't think you can, nor would you want to at this point. It would just be another standard (ala XKCD-927). Virtualenvs, pip, and wheels have been better than eggs and whatever else came before wheels.
Once you set the version of python in the virtualenv and activate it, the right python will always be there. The virtualenv even has an instance of python in it's bin. When that python is run, whatever's installed in the virtualenv comes with it.
Poetry, however, does suck even though it's using virtualenv underneath. It's doing frankly too much and seems to have a lot of regressions. In the end it should only be looking at the contents of the virtualenv and using pip to install the correct packages into it.
Edited to add: With the last version of poetry causing issues in my development env, I'm about ready to ban it from our team.
- trallnag 4y agoVirtualenv has a Python in its bin? Any source on that?
- jeroenhd 4y agoVenvs will actually contain a symlink to a python binary in its venv/bin directory. It doesn't copy a Python executable or download one from the internet as far as I can tell. Still, this means you can install multiple system Python versions and your venv will always contain an executable file of the version the venv was last installed/updated with. ╭─android@localhost ~/tmp/py ╰─$ python3 -m venv testvenv ╭─android@localhost ~/tmp/py ╰─$ file testvenv/bin/python3 testvenv/bin/python3: symbolic link to /data/data/com.termux/files/usr/bin/python3
- Xophmeister 4y agoThere’s a command line flag that will make it create an actual copy, rather than a symlink.
- bb88 4y agoIt's a copy on windows too.
- deaddodo 4y agoVenv creates a /bin in it's environment dir that symlinks the Python version used to initialize it or as specified. That's it's entire basic model of operation and takes a few seconds to verify.