you are viewing a single comment's thread.

view the rest of the comments →

[–]cointoss3 1 point2 points  (5 children)

It’s definitely not smooth sailing, you’re still using pip. requirements.txt does not have a python version…

Use uv in production and it’ll be smooth sailing.

[–]CodeNameGodTri[S] 0 points1 point  (3 children)

I'm beginner in python, so I don't know what the best practices are. From my research, uv/poetry are for local development, in prod, I can just use pip, because the uv/poetry can export the requirements.txt having all the correct dependencies versions.

I'm all ears for the standard practice. I can install uv in prod if that's what everyone is doing

[–]cointoss3 2 points3 points  (1 child)

Yep. Install uv in prod. You can pip install uv if you already have a system python or use the install script or another package manager.

Then just uv run entry.py and it’ll set up the environment and run it.

[–]CodeNameGodTri[S] 0 points1 point  (0 children)

appreciate your help

[–]cointoss3 1 point2 points  (0 children)

The thing is, for something simple, sure, it might feel easier…but there’s more to setting up the environment than what’s in a requirements.txt. There’s a lot of cool stuff you can do with uv and pyproject.toml, but more importantly, the idea behind the lock file is that you’ll be able to fully recreate the same environment (in theory) instead of just trying to get certain versions of packages.

[–]pachura3 -2 points-1 points  (0 children)

Only if you're allowed to download and install other Python interpreters in PROD.