dosubot[bot] commented on issue #37126:
URL: https://github.com/apache/superset/issues/37126#issuecomment-3748636847

   <!-- Greeting -->
   Hi @bimbolimbo! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.
   
   <!-- Answer -->
   You're correct: the postgres extra in Superset's pyproject.toml is pinned to 
psycopg2-binary==2.9.6, which does not have pre-built wheels for Python 3.12. 
This causes pip to attempt a source build, resulting in the gcc error you 
described in minimal Docker images 
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/pyproject.toml#L164-L164)).
 
   
   This issue is widely reported by users running Superset on newer Python 
versions and containerized environments 
([discussion](https://github.com/apache/superset/discussions/31431)). The most 
robust workaround is to install psycopg2-binary>=2.9.9, which provides Python 
3.12 wheels and avoids the need for build tools. However, as of now, the 
official Superset dependencies have not been updated to reflect this, and there 
is no official fix merged yet ([PR 
reference](https://github.com/apache/superset/pull/35771)).
   
   If you need to proceed before an official update, you can override the 
dependency in your Dockerfile with:
   ```
   RUN pip install 'psycopg2-binary>=2.9.9'
   ```
   This should resolve the build failure on Python 3.12 images.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/d9843b2d-c6b8-4b2f-81c8-6376f57072c7?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/d9843b2d-c6b8-4b2f-81c8-6376f57072c7?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/d9843b2d-c6b8-4b2f-81c8-6376f57072c7?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/d9843b2d-c6b8-4b2f-81c8-6376f57072c7?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/d9843b2d-c6b8-4b2f-81c8-6376f57072c7?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/d9843b2d-c6b8-4b2f-81c8-6376f57072c7?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/d9843b2d-c6b8-4b2f-81c8-6376f57072c7?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=You%27re%20correct%3A%20the%20postgres%20extra%20in%20Superset%27s%20pyproject.toml%20is%20pinned%20to%20psycopg2-binary%3D%3D2.9.6%2C%20which%20does%20not%20have%20pre-built%20wheels%20for%20Python%203.12.%20This%20causes%20pip%20to%20attempt%20a%20source%20build%2C%20resulting%20in%20the%20gcc%20error%20you%20described%20in%20minimal%20Docker%20images%C2%A0%28%5Bsource%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/pyproject.toml%23L164-L164%29%29.%20%0A%0AThis%20issue%20is%20widely%20reported%20by%20users%20running%20Superset%20on%20newer%20Python%20versions%20and%20containerized%20environments%C2%A0%28%5Bdiscussion%5D%28https%3A//github.com/apache/superset/discussions/31431%29%29.%20The%20most%20robust%2
 
0workaround%20is%20to%20install%20psycopg2-binary%3E%3D2.9.9%2C%20which%20provides%20Python%203.12%20wheels%20and%20avoids%20the%20need%20for%20build%20tools.%20However%2C%20as%20of%20now%2C%20the%20official%20Superset%20dependencies%20have%20not%20been%20updated%20to%20reflect%20this%2C%20and%20there%20is%20no%20official%20fix%20merged%20yet%C2%A0%28%5BPR%20reference%5D%28https%3A//github.com/apache/superset/pull/35771%29%29.%0A%0AIf%20you%20need%20to%20proceed%20before%20an%20official%20update%2C%20you%20can%20override%20the%20dependency%20in%20your%20Dockerfile%20with%3A%0A%60%60%60%0ARUN%20pip%20install%20%27psycopg2-binary%3E%3D2.9.9%27%0A%60%60%60%0AThis%20should%20resolve%20the%20build%20failure%20on%20Python%203.12%20images.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20hel
 
ped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37126)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to