3 ms·
Just use the builtin "python -m venv" and life is good, why the others? I tried almost all of them, with various issues, now staying with the default venv, it's
by synergy20 3y ago
Just use the builtin "python -m venv" and life is good, why the others?
I tried almost all of them, with various issues, now staying with the default venv, it's solid and get the job done.
- jvansc 3y agoYeah, my thoughts exactly. I’ve never found myself in a situation where venv did not do exactly what I needed it to do.
- Karunamon 3y agoThe problem there is that by default a virtual environment version of Python is just a symbolic link to the actual binaries installed elsewhere on the machine. If you do an OS upgrade or do anything that increments the system Python version, it could cause problems in the environment.
- claytonjy 3y agopyenv manages python versions, not virtual environments. venv won't help you grab python versions you don't have, and will happily install your requirements into a venv with the wrong python version.
- kzrdude 3y agoThe premise of controlling python version is that - you're sending the project to your friend / colleague and you want both of you to use the same python version so that you get the same behaviour. And then the same for your friend the buildserver. It's all about reproducibility.
- synergy20 3y agowhich venv does really well, what am I missing. in the "worst" case you can always do a docker
- dragonwriter 3y agovenv only works if you already have the required version of python installed and have it active as the python for your shell (or use a launcher to which you specify the python to use in the command line), since venv just creates a virtual environment based on the version of python it is run with. So you actually need something that can read a specification of the required python version and use the correct one from the available options (maybe even reaching out and getting it if it isn't already locally available, though I don5 remeber if any of the existing python build tools will do this; docker obviously will, but its not really a python build tool), across different OS flavors (maybe not that last bit, depending on the use case, especially for internal development), and with minimal overhead for the build tool itself.