If one is going to be futzing around with #python on their system, I think the best way to inoculate/isolate one's user-space from the system is to install #pyenv
I used to completely pollute my installations by mucking up #pip installations with installing distribution python packages and end up struggling to get them working together properly.
pyenv is a great prophylactic if one doesn't need the #conda environment.
Noticed my starship prompt was a bit sluggish sometimes. Apparently it was spending some time (180-200ms) getting `python --version` outside of venv via pyenv's shims. Bash shims are usually fine, but performance matters in starship.
Switched to rtx runtime manager and voila, rapid prompt again! Loved rtx so much I've fully migrated from pyenv.
Thanks to @jdx for rtx and @astrojuanlu for recommendations!
Ich habe vor einigen Tagen #pyenv kennengelernt. Ich liebe es:
Mit pyenv kann ich verschiedene Python-Versionen verwalten und für die Shell, den Ordner oder Global "mal eben" die zu nutzende Python-Version festlegen.
Ich sollte mir nur merken, was ich wann geändert habe. Eben wollte Lutris nicht mehr starten, da Python 3.10.0 und nicht 3.11.x gesetzt war...
Ich habe vor einigen Tagen #pyenv kennengelernt. Ich liebe es:
Mit pyenv kann ich verschiedene Python-Versionen verwalten und für die Shell, den Ordner oder Global "mal eben" die zu nutzende Python-Version festlegen.
Ich sollte mir nur merken, was ich wann geändert habe. Eben wollte Lutris nicht mehr starten, da Python 3.10.0 und nicht 3.11.x gesetzt war...
#python #node #rtx (Polyglot runtime manager (#asdf #rust clone))
- https://dev.to/jdxcode/beginners-guide-to-rtx-ac4
- https://github.com/jdxcode/rtx
rtx is a tool that manages installations of programming language runtimes and other tools for local development.
If you are using #pyenv, nvm, or #asdf, you'll have a better experience with rtx. It's faster, easier to use, and generally has more features than any of those.
It's useful if you want to install a specific version of node or python or if you want to use different versions in different projects.
- https://github.com/jdxcode/rtx#features
asdf-compatible - rtx is compatible with asdf plugins and .tool-versions files. It can be used as a drop-in replacement.
Polyglot - compatible with any language, so no more figuring out how nvm, nodenv, pyenv, etc work individually—just use 1 tool.
Fast - rtx is written in Rust and is very fast. 20x-200x faster than asdf.
No shims - shims cause problems, they break which, and add overhead. By default, rtx does not use them—however you can if you want to.
Fuzzy matching and aliases - It's enough to just say you want "v20" of node, or the "lts" version. rtx will figure out the right version without you needing to specify an exact version.
Arbitrary env vars - Set custom env vars when in a project directory like NODE_ENV=production or AWS_PROFILE=staging.
#python #asdf #rust #pyenv #features #node #rtx
I'm like "how do I install #pyenv in #NixOS?" and then I realize I don't need pyenv in NixOS. #enlightenment
https://www.codyhiar.com/blog/replace-pyenv-with-a-nix-flake/
I dislike pyenv so much.
There, I said it. I'm actively avoiding it in all my projects, and I'm sad it's the default option on Gitpod.
#python #packaging #shenanigans #rabbitholes #lamehashtags #pyenv #gitpod
#python #packaging #shenanigans #rabbitholes #lamehashtags #pyenv #gitpod
📝 "pyenv in RStudio"
👤 Isabel Zimmerman (@isabelizimm)
🔗 https://isabelizimm.github.io/posts/pyenv-in-rstudio/pyenv-crying.html
There's honestly not a lot about #python that has impressed me over the last decade. It was simply a gateway language for me. However, #hatch and #pyenv have definitely done so. How trivial it is to run tests across multiple versions of python including prerelease, actual dependency tree solving, domain specific dependencies. It's added a little much needed joy to python project management that was sorely needed.
I've got a number of small #python projects using Poetry & #pyenv and this is the workflow that I've got for when a new Python version is released:
- pyenv install 3.11.3
- edit `~/.local/pypoetry/venv/pyvenv.cfg` and replace with new Python version
- `poetry env remove 3.11.2`
- edit `.python-version` in the local project directory with updated Python version(s)
- `poetry install`
- `poetry env info` for verification
Is there a better, more efficient way to do this?
https://dev.to/mhf/managing-multiple-versions-of-python-using-pyenv-and-virtualenvwrapper-383h - #pyenv, the #Python fast version switcher. Or make #venv targeting specific versions. Great tutorial https://twitter.com/margaritahforg.
Using #pyenv makes it easy to install and switch between multiple versions of #Python on a #Linux system. It also enables a clean separation between the Python installed by the system (required for its maintenance and to satisfy package dependencies), and other Python versions and libraries installed by the user: https://www.dwarmstrong.org/pyenv/
A new package version of pyenv v2.3.13 is available for openSUSE.
"pyenv lets you easily switch between multiple versions of Python. It is simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well."
https://build.opensuse.org/package/show/devel:languages:python/pyenv
Going to install and try out #pyenv, so I decided it was time to update #homebrew on my MacBook. I ran brew update and it took forever to run. I thought it had hung up. It finished and said to run brew upgrade. I was warned that MacOS Mojave is no longer supported. I hadn't wanted to update to Catalina, but my resistance has been waning. So once the the upgrade is done, I'll install pyenv, play with it a bit and then upgrade to Catalina. Anyway, upgrade is taking even longer than update.
#python #packaging #pyenv #poetry
- https://chriswarrick.com/blog/2023/01/15/how-to-improve-python-packaging/
Personnaly I use pyenv and poetry
- https://gdevops.gitlab.io/tuto_python/installation/gnu_linux/pyenv/pyenv.html
- https://gdevops.gitlab.io/tuto_python/distribution/packaging/poetry/poetry.html
#poetry #pyenv #packaging #python
https://realpython.com/intro-to-pyenv/#installing-pyenv
Before you install pyenv itself, you’re going to need some OS-specific dependencies
```
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
```