Live data from Hacker News

Python environment setup seems complicated and unsolvable

stackoverflow.com

1–10 of 34 posts

Re: Python environment setup seems complicated and unsolvable

#2
> Instead of creating virtual environments using venv, you can use a more sophisticated tool like Poetry which enables you to manage you environments in a much better manner.

It seems pretty emblematic of the shitshow that is Python environment management that the top-rated comment is recommending something I've never heard of. I know pyenv and pyvenv (not the same thing!) and virtualenv and venv (not the same thing!) and pipenv, but apparently those are all now out of date and I should be moving to this sixth new tool. I'm sure this time it will be fixed for good.

Re: Python environment setup seems complicated and unsolvable

#4

> Instead of creating virtual environments using venv, you can use a more sophisticated tool like Poetry which enables you to manage you environments in a much better manner. It seems pretty emblematic of the shitshow that is Python environment management that the top-rated comment is recommending something I've never heard of. I know pyenv and pyvenv (not the same thing!) and virtualenv and venv (not the same thing!…

Poetry is an all-in-one tool that does dependency management using `pyproject.toml` files and its own `poetry.lock` files, as well as package building, virtualenv management, and also has hooks for entrypoints and scripts.

It's rather a useful tool and I'm personally using it for dependency management and packing for all my projects moving forwards, though for venvs I'm using `pyenv` and the `pyenv-virtualenv` plugin.

Once you figure out your workflow it can be quite nice, but it's figuring it out that's a huge mess in Python at the minute. Hopefully PEP 582 (Python local packages directory) solves it a bit...

Re: Python environment setup seems complicated and unsolvable

#5

> Instead of creating virtual environments using venv, you can use a more sophisticated tool like Poetry which enables you to manage you environments in a much better manner. It seems pretty emblematic of the shitshow that is Python environment management that the top-rated comment is recommending something I've never heard of. I know pyenv and pyvenv (not the same thing!) and virtualenv and venv (not the same thing!…

Actually PDM is the best python package manager tool!

Re: Python environment setup seems complicated and unsolvable

#7
I just gave up on learning Python because of this mess. It's really too bad, because I'd like to write utilities with Python that would run on almost any machine.

Oh well.

When I was still trying to wrangle this, I had followed this guide on setting up Python "the right way." I wonder what y'all think: https://opensource.com/article/19/5/python-3-default-mac

Re: Python environment setup seems complicated and unsolvable

#8
post #5

> Instead of creating virtual environments using venv, you can use a more sophisticated tool like Poetry which enables you to manage you environments in a much better manner. It seems pretty emblematic of the shitshow that is Python environment management that the top-rated comment is recommending something I've never heard of. I know pyenv and pyvenv (not the same thing!) and virtualenv and venv (not the same thing!…

Actually PDM is the best python package manager tool!

I was going to say that too, but then I was like "yep, that's exactly the problem!"

Re: Python environment setup seems complicated and unsolvable

#9
post #4

> Instead of creating virtual environments using venv, you can use a more sophisticated tool like Poetry which enables you to manage you environments in a much better manner. It seems pretty emblematic of the shitshow that is Python environment management that the top-rated comment is recommending something I've never heard of. I know pyenv and pyvenv (not the same thing!) and virtualenv and venv (not the same thing!…

Poetry is an all-in-one tool that does dependency management using `pyproject.toml` files and its own `poetry.lock` files, as well as package building, virtualenv management, and also has hooks for entrypoints and scripts. It's rather a useful tool and I'm personally using it for dependency management and packing for all my projects moving forwards, though for venvs I'm using `pyenv` and the `pyenv-virtualenv` plugin…

PEP 582 was rejected, FYI.

https://peps.python.org/pep-0582/

Re: Python environment setup seems complicated and unsolvable

#10
IMHO, Poetry is the best we have in the Python dep mgmt space, and it's still endlessly frustrating. It's especially hard to recommend it for newbies looking to get up and running with even a simple ML stack. Check out this thread[1] on the Kafkaesque nightmare that is trying to install PyTorch with Poetry.

[1]: https://github.com/python-poetry/poetry/issues/6409

Post reply on HN