tiangolo / uvicorn-gunicorn-fastapi-docker

Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python with performance auto-tuning.
MIT License
2.61k stars 329 forks source link

Upgrade from python3.8 to python3.11 fails #224

Open zurferr opened 1 year ago

zurferr commented 1 year ago

Hello,

just wanted to report that I have an existing Dockerfile that is build on top of FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-2022-11-25 Everything works great!

When I try to upgrade the Python version to 3.11 I receive the following error, when installing my dependencies.

> [build-stage 5/5] RUN pip install --no-cache-dir -q -r requirements.txt:
#9 5.388   error: subprocess-exited-with-error
#9 5.388
#9 5.388   × Preparing metadata (pyproject.toml) did not run successfully.
#9 5.388   │ exit code: 1
#9 5.388   ╰─> [6 lines of output]
#9 5.388
#9 5.388       Cargo, the Rust package manager, is not installed or is not on PATH.
#9 5.388       This package requires Rust and Cargo to compile extensions. Install it through
#9 5.388       the system's package manager or via https://rustup.rs/
#9 5.388
#9 5.388       Checking for Rust toolchain....
#9 5.388       [end of output]
#9 5.388
#9 5.388   note: This error originates from a subprocess, and is likely not a problem with pip.
#9 5.390 error: metadata-generation-failed
#9 5.390
#9 5.390 × Encountered error while generating package metadata.
#9 5.390 ╰─> See above for output.
#9 5.390
#9 5.390 note: This is an issue with the package mentioned above, not pip.
#9 5.390 hint: See above for details.
#9 5.527
#9 5.527 [notice] A new release of pip available: 22.3 -> 22.3.1
#9 5.527 [notice] To update, run: pip install --upgrade pip
------
executor failed running [/bin/sh -c pip install --no-cache-dir -q -r requirements.txt]: exit code: 1

Here are some of the dependencies that I suspect. However, they install correctly on 3.8

orjson==3.5.1
confluent-kafka==1.8.2
snowflake-connector-python==2.8.1

Would love to get your thoughts how you would approach that?

codvlpr commented 3 months ago

The problem comes from orjson package. It is a Rust-based library if you upgrade it to the latest version (3.9.15) then it'd probably resolve this issue.