Cannot build FASTAPI python server

My code works locally - but does not work on render.
Its a fastapi based python server - and I get the following error during the deploy / pip install process.

PLEASE HELP
creating build/temp.linux-x86_64-cpython-311/lib

Aug 5 12:13:43 AM gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/opt/render/project/src/.venv/include -I/usr/local/include/python3.11 -c lib/zoneinfo_module.c -o build/temp.linux-x86_64-cpython-311/lib/zoneinfo_module.o -std=c99

Aug 5 12:13:43 AM lib/zoneinfo_module.c: In function ‘zoneinfo_fromutc’:

Aug 5 12:13:43 AM lib/zoneinfo_module.c:600:19: error: ‘_PyLong_One’ undeclared (first use in this function); did you mean ‘_PyLong_New’?

Aug 5 12:13:43 AM one = _PyLong_One;

Aug 5 12:13:43 AM ^~~~~~~~~~~

Aug 5 12:13:43 AM _PyLong_New

Aug 5 12:13:43 AM lib/zoneinfo_module.c:600:19: note: each undeclared identifier is reported only once for each function it appears in

Aug 5 12:13:43 AM error: command ‘/usr/bin/gcc’ failed with exit code 1

Aug 5 12:13:43 AM [end of output]

Aug 5 12:13:43 AM

Aug 5 12:13:43 AM note: This error originates from a subprocess, and is likely not a problem with pip.

Aug 5 12:13:43 AM ERROR: Failed building wheel for backports.zoneinfo

Aug 5 12:13:43 AM Building wheel for Flask-JWT (pyproject.toml): started

Aug 5 12:13:43 AM Building wheel for Flask-JWT (pyproject.toml): finished with status ‘done’

Failed to build backports.zoneinfo

Aug 5 12:14:12 AMERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

Aug 5 12:14:12 AM

Aug 5 12:14:12 AM

Hi,

There will always be differences between environments: development mode/Local, production mode/Render, OS, versions, resources, etc. These differences need to be considered and configured as required for your own app in each environment.

A quick search for the error “Could not build wheels for backports.zoneinfo”, brings up this Stack Overflow post: https://stackoverflow.com/questions/71712258/error-could-not-build-wheels-for-backports-zoneinfo-which-is-required-to-insta

That seems to suggest that the Python version may be the issue. Render’s current Python default is 3.11.9. Maybe try setting the Python version to the same one you developed/tested.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.