10 comments

[ 1.9 ms ] story [ 23.0 ms ] thread
Telling people to apt-get or brew install python isn’t good advice. It’s best to use something like pyenv so an upgrade doesn’t get rid of the version of python you were relying on.
Exactly. Always, always create a virtual environment of some sorts for your python projects, unless you don't use external dependecies at all.

I ended up using poetry in the end.

Yes, that too, but GP isn't talking about virtual environments.
Or just run it in a container!
Poetry wins over a container because you have better version control (minimum/maximum specs as per your pyproject.toml file) and makes sure your users get the same build (as per poetry.lock).

Additionally if what you are building is a library, then a container won't fly as you (to my knowledge) cannot publish these to pypi (to make them installable via pip install foo)

The trick is to not rely on a specific version of python, because they do go EOL and stop receiving fixes.
Thats not a trick, every version of software eventually reaches EOL. Thats why there is semantic versioning, etc. What do you think happens when security vulnerabilities are found in a version of software. Your comment is meaningless.
I'd be careful recommending pyenv to beginners too. I've seen it turn an interns system python install to absolute mush. Took some real doing to finally get pyenv unhooked from the system and everything back in working order.
I built my last project in Flask. It was a joy to work with, but I quickly discovered that it's not really meant for single-page applications. I ended up mostly using it as an API while the bulk of the work was done with javascript. In retrospect it would have been easier to just use something like FastAPI.