[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"problem-detail-error-python-install-fails-while-building-psycopg2":3},{"stack":4,"error":5,"seoName":6,"seoStack":7,"seo":8,"breadcrumb":10,"titlePrefix":17,"titleAccent":18,"lead":19,"facts":22,"why":37,"log":54,"fix":83,"engine":107,"related":118,"pitch":125},"python","python-install-fails-while-building-psycopg2","Python install fails while building psycopg2","Python",{"description":9},"Learn what causes Python install fails while building psycopg2, how PanelAlpha Engine responds to it during deployment.",[11,14,16],{"label":12,"href":13},"App Installations","\u002Fapps",{"label":7,"href":15},"\u002Fapps\u002Fstacks\u002Fpython",{"label":6},"Python install fails while ","building psycopg2",[20],{"text":21},"Error recorded 1 times in PanelAlpha Engine deploys on Python. The deploy log below is the recorded failure output.",[23,28,31,33],{"label":24,"value":25,"tone":26,"tooltip":27},"Type","Error","err","An error that occurred in the deployed application. It is not necessarily a PanelAlpha Engine error, but we keep working on improvements so you run into fewer of them.",{"label":29,"value":30},"Seen","1 times",{"label":32,"value":7},"Where",{"label":34,"value":35,"tooltip":36},"Status","Observed","Our team will look into this soon, verify the cause and try to fix it in an upcoming release.",{"heading":38,"body":39},"Why it happens",[40,42,45,47,49,51,52],{"text":41},"The deployment installs ",{"text":43,"code":44},"psycopg2==2.9.9",true,{"text":46}," from source because no compatible wheel was selected. Building it requires PostgreSQL's ",{"text":48,"code":44},"pg_config",{"text":50},", which is missing from the Python build environment. The license warning is informational; the missing ",{"text":48,"code":44},{"text":53}," causes the failure.",{"heading":55,"block":56},"What the log looks like",{"header":57,"lines":58},"Deploy log",[59,63,67,71,75,79],{"segments":60},[61],{"text":62},"Collecting psycopg2==2.9.9",{"segments":64},[65],{"text":66},"Downloading psycopg2-2.9.9.tar.gz",{"segments":68},[69],{"text":70},"Getting requirements to build wheel: finished with status 'error'",{"segments":72},[73],{"text":74},"error: subprocess-exited-with-error",{"segments":76},[77],{"text":78},"Error: pg_config executable not found.",{"segments":80},[81],{"text":82},"pg_config is required to build psycopg2 from source.",{"heading":84,"steps":85,"block":104},"How to fix it",[86],[87,89,90,92,94,96,98,100,102],{"text":88},"Install the PostgreSQL client development package in the build environment so ",{"text":48,"code":44},{"text":91}," is on ",{"text":93,"code":44},"PATH",{"text":95}," (for example, the Debian\u002FUbuntu package that provides ",{"text":97,"code":44},"libpq-dev",{"text":99},"). Alternatively, use a compatible ",{"text":101,"code":44},"psycopg2-binary",{"text":103}," dependency if appropriate for this application. Rebuild after confirming the selected Python runtime and dependency set are supported.",{"header":105,"lines":106},"Fix by hand",[],{"heading":108,"body":109,"block":115},"How PanelAlpha Engine solves it",[110,112,113],{"text":111},"Detect missing native build tools such as ",{"text":48,"code":44},{"text":114}," during dependency installation and report the owning system package before the generic subprocess failure. The Python strategy could also identify when a binary package or a different supported runtime may avoid a source build.",{"header":116,"lines":117},"",[],{"heading":119,"items":120},"Apps affected",[121],{"title":122,"badge":123,"tone":26,"href":124},"Discover Flask","1 occurrence","\u002Fapps\u002Frealpython\u002Fdiscover-flask",{"heading":126,"body":127,"footNote":128,"docsLabel":129,"docsHref":130},"Try PanelAlpha Engine yourself.","The easiest way to turn your server into a safe, controlled environment for your AI agent. Deploy, manage and maintain any project from Claude Code, Cursor, Codex or any other MCP client. Open source under Apache 2.0, free to run.","Requires Ubuntu 24.04 or 26.04 · 2 GB RAM · 1 CPU","Read the documentation","https:\u002F\u002Fpanelalpha.com\u002Fdocs"]