You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got caught out using these examples, since both the standard and multistage built fine. However, the multistage image wouldn't run, instead exiting with a ModuleNotFoundError.
It took a while to figure out, but I found that because my .python-version file, which contained a different version to that specified on the container image, had been copied during the build, uv was using that to install and run, which later broke the app.
This can be overcome by specifiying UV_SYSTEM_PYTHON=true as an env to make sure that the container-specified Python version is used.
The docs also specify it for this purpose:
UV_SYSTEM_PYTHON=true is intended for use in continuous integration (CI) or containerized environments
Yeah that also works. I have both in my project now, but I like the environment variable since it sits alongside the other build-specific settings. e.g.
I got caught out using these examples, since both the standard and multistage built fine. However, the multistage image wouldn't run, instead exiting with a
ModuleNotFoundError
.It took a while to figure out, but I found that because my .python-version file, which contained a different version to that specified on the container image, had been copied during the build, uv was using that to install and run, which later broke the app.
This can be overcome by specifiying
UV_SYSTEM_PYTHON=true
as an env to make sure that the container-specified Python version is used.The docs also specify it for this purpose:
https://docs.astral.sh/uv/configuration/environment/#UV_SYSTEM_PYTHON
The text was updated successfully, but these errors were encountered: