5 ms·
I like to use pyenv for this purpose, as it "virtualizes" Python versions by installing them locally as you mention. Then you just point each virtualenv at the
by TYPE_FASTER 6y ago
I like to use pyenv for this purpose, as it "virtualizes" Python versions by installing them locally as you mention. Then you just point each virtualenv at the Python binary for the version installed via pyenv. pyenv + virtualenv + virtualenvwrapper have greatly reduced Python dependency issues for me.
- giancarlostoro 6y agoA bunch of programming languages do a little bit similar like Node has Node Version Manager or nvm, I think Go has GVM, Rust just has Rust Up, they usually install in your home folder and let you swap between versions globally, I've yet to have to do this as I usually spin up a VM if I know I'm going to need to deploy to a very specific version of Debian / Ubuntu, a virtual environment might not match behavior on the actual target system but a VM definitely will.
- fidelramos 6y ago+1 to pyenv. And it's even better if you combine it with pipenv [1]: pipenv manages dependencies its own file (Pipfile) which can also specify the required Python version. Pipenv integrates with pyenv so if the required Python version is not available it will offer to download and install it. Tldr; with pyenv and pipenv installing a Python project is just "pipenv install". [1] https://pipenv.pypa.io/en/latest/ https://pipenv.pypa.io/en/latest/
- strbean 6y agoI would strongly recommend taking a look at Poetry as an alternative to Pipenv. Pipenv is honestly a nightmare.
- kstrauser 6y agoI regret I can only upvote this once. Pipenv still gets press, but I'm not sure why. Every senior dev I know switched to Poetry long ago.
- fidelramos 6y agoI have been using pipenv only on a couple of projects and for a few months, but it has been an improvement over pip and virtualenv. Why do you say Pipenv is a nightmare? Have you had bad experiences with it?