5 ms·
Virtualenv has a Python in its bin? Any source on that?
by trallnag 4y ago
Virtualenv 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.