pyenv/pyenv: Simple Python version management

3 years ago by Jason Novinger to c/python

Simple Python version management. Contribute to pyenv/pyenv development by creating an account on GitHub.

Simple Python [executable] version management, that is.

Andy 5 points 3 years ago

I highly recommend rtx over pyenv/asdf. For one thing, you'll still be able to which python and get a useful response, as it works by altering your PATH rather than relinking shims.

path: 0 831217, hotness: undefined, score: 5, children: 2
brettvitaz 2 points 3 years ago

I wouldnโ€™t argue that a useful response from which isnโ€™t a good thing, but how often do you need to use it with Python? Iโ€™ve been using pyenv with pipenv for years and almost never need to do this.

path: 0 831217 835532, hotness: undefined, score: 2, children: 1
Andy 1 point 3 years ago

How often? Sometimes ๐Ÿคท.

There are other benefits to the tool that may be more meaningful for your usage, but of course I wouldn't claim there's anything wrong with using the tools you like.

I think when I used pyenv it was the single slowest part of my shell initialization.

path: 0 831217 835532 856397, hotness: undefined, score: 1, children: 0
ngons 4 points 3 years ago

I use it everyday. I feel itโ€™s my secret sauce in python devโ€ฆ pyenv-virtualenv is pretty useful with it also

path: 0 836620, hotness: undefined, score: 4, children: 0
jeebus 3 points 3 years ago

When bringing people online from other languages, I first get them to find out what python there is in their environment and go with that if it's recent enough. Then I tell them about pyenv and it's plugins after a bit. Whenever I go straight into installing pyenv, it feels like I'm throwing some one in the deep ocean.

path: 0 839664, hotness: undefined, score: 3, children: 1
muppetjones 2 points 3 years ago

I've seen too many issues caused by relying on the system python. For starters, it's much more difficult to fix if you screw something up.

I tell everyone to use pyenv -- but only to install specific versions of python. I then create a primary venv for a couple of versions, and that's what I use as my "system" version. Each project creates a separate venv based on the pyenv versions. I use autoenv to activate and deactivate as needed.

It's a little more setup, but it avoids so much magic, and it's extremely robust.

path: 0 839664 1011535, hotness: undefined, score: 2, children: 0
jim 2 points 3 years ago

I've used pyenv for years and it's an awesome tool. Keeps python binaries separate and it has a virtualenv plugin. I've gotten others to use it as well.

It works great for library owners who need to run tox/nox on multiple versions of python in test suites. Love it.

path: 0 822625, hotness: undefined, score: 2, children: 0
redcalcium 2 points 3 years ago

Another useful Python version manager is asdf with python plugin. The most helpful feature of asdf is ability to specify what Python version to use in certain directory by simply placing a .tool-versions file (contains the version number to use) in that directory. This makes working with multiple projects that requires different version of Python very seamless.

path: 0 820978, hotness: undefined, score: 2, children: 6
jim 4 points 3 years ago

pyenv also has this with the .python-version file which will switch versions. And with the plugin, you can use virtualenvs in pyenv so that a .python-version can be simply: my-cool-project-virtualenv and switching to that directory automatically switches to it.

path: 0 820978 822584, hotness: undefined, score: 4, children: 2
ngons 3 points 3 years ago

This is a great feature

path: 0 820978 822584 837345, hotness: undefined, score: 3, children: 0
redcalcium 3 points 3 years ago

Automatically switching to virtual environment seems like an even useful thing to me. Thanks for mentioning it.

path: 0 820978 822584 823052, hotness: undefined, score: 3, children: 0
jnovinger 2 points 3 years ago

Ooh, thanks for mentioning asdf! I've heard of it, but didn't realize it could that

path: 0 820978 821287, hotness: undefined, score: 2, children: 2
Andy 1 point 3 years ago

AFAIU, asdf uses pyenv for its Python plugin, but rtx does it all just a little better.

path: 0 820978 821287 834739, hotness: undefined, score: 1, children: 1
hosaka 3 points 3 years ago path: 0 820978 821287 834739 838578, hotness: undefined, score: 3, children: 0
CodeBlooded 2 points 3 years ago

I found pyenv to be buggy at times, not properly setting the default (global) python version. I ultimately uninstalled pyenv and also uninstalled any additional Python installs outside of the system default.

Now, I do 100% of my Python work inside of Docker containers. This has solved any issues Iโ€™ve ever had with Python environments and PYTHONPATH . Itโ€™s also made me a stronger developer when it comes to using Docker.

I donโ€™t see myself ever going back. A Docker container is the perfect Python environment.

path: 0 836511, hotness: undefined, score: 2, children: 0
lig 1 point 3 years ago

I'm just incredibly happy that Fedora has every Python version in its official repo and I don't need pyenv at all.

path: 0 840303, hotness: undefined, score: 1, children: 0
python
python

@programming.dev

login for more options
8076
745
292

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events
Past

November 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
  • Pythรถrhead: a Python library for interacting with Lemmy
  • Plemmy: a Python package for accessing the Lemmy API
  • pylemmy pylemmy enables simple access to Lemmy's API with Python
  • mastodon.py, a Python wrapper for the Mastodon API
Feeds

go to feed...