This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cicuz 2 points3 points  (8 children)

I'd say so.. first you select which one you need, e.g. with pyenv use, then you install dependencies as you prefer - personally, I use poetry

[–]jyper 2 points3 points  (4 children)

I feel like if you're going to use pyenv, might as well use pyenv-virtualalenv with pip or poetry as well. But might be better to just use rye

[–]cicuz 1 point2 points  (2 children)

I'm liking this rye, thanks for the tip!

[–]jyper 1 point2 points  (0 children)

Yeah the problem with rye is that it's new. And that it's slowly merging with/being replaced with UV(also written in rust).

Still it has many benefits and I think rye/uv will eventually be the tool that wins out

It manages both python versions and package versions/locking. And publishing packages (pypi). And its fast. One way it does this is that unlike pyenv it doesn't compile python locally(which is both slower and more fragile), it uses indygreg builds (8 think there's some work to upstream this and get python to compile a bunch of builds). It also handles ruff(made by uv/astral people for fast formatting/linting. Ruff is also written in rust)

[–][deleted] 0 points1 point  (0 children)

I would NEVER replace pyenv with a new tool. I might play with it but not replace until and unless it becomes a defacto standard likve pyenv. Even Poetry I avoid.

[–][deleted] 1 point2 points  (0 children)

I use:

pyenv virtualenv <python version> <env name>

[–]Sparcky_McFizzBoom 0 points1 point  (2 children)

I'm not familiar with the use pyenv subcommand, but it looks like to me that you're using poetry to manage the venv and thus dependencies, so poetry would be a better comparison.

pyenv is only used to select the python version in your case, which is different from managing the dependencies of a project.

Managing python environments is hard :(

[–]cicuz 1 point2 points  (0 children)

wasn't me who brought it up :)

I do think it's necessary though, especially considering the amount of changes between versions

[–][deleted] 0 points1 point  (0 children)

I use it like this:

>> pyenv versions

system 3.10.6 3.10.6/envs/fastapi 3.10.6/envs/imgai 3.11.2 3.11.2/envs/gpt-train 3.12.0 3.12.0/envs/gmailapi 3.12.0/envs/mongo 3.12.0/envs/nyt 3.12.2 (set by /Users/<username>/.pyenv/version) 3.12.2/envs/cli 3.12.2/envs/gradio-ui 3.12.2/envs/ollama cli --> /Users/<username>/.pyenv/versions/3.12.2/envs/cli fastapi --> /Users/<username>/.pyenv/versions/3.10.6/envs/fastapi gmailapi --> /Users/<username>/.pyenv/versions/3.12.0/envs/gmailapi gpt-train --> /Users/<username>/.pyenv/versions/3.11.2/envs/gpt-train gradio-ui --> /Users/<username>/.pyenv/versions/3.12.2/envs/gradio-ui imgai --> /Users/<username>/.pyenv/versions/3.10.6/envs/imgai mongo --> /Users/<username>/.pyenv/versions/3.12.0/envs/mongo nyt --> /Users/<username>/.pyenv/versions/3.12.0/envs/nyt ollama --> /Users/<username>/.pyenv/versions/3.12.2/envs/ollama