Cannot build because of psycopg2

johnivanpuayapTRIAL

9 months ago

Getting requirements to build wheel: finished with status 'error'

10 10.31 error: subprocess-exited-with-error

10 10.31

10 10.31 × Getting requirements to build wheel did not run successfully.

10 10.31 │ exit code: 1

10 10.31 ╰─> [21 lines of output]

10 10.31 running egg_info

10 10.31 writing psycopg2.egg-info/PKG-INFO

10 10.31 writing dependencylinks to psycopg2.egg-info/dependencylinks.txt

10 10.31 writing top-level names to psycopg2.egg-info/top_level.txt

10 10.31

10 10.31 Error: pg_config executable not found.

10 10.31

10 10.31 pg_config is required to build psycopg2 from source. Please add the directory

10 10.31 containing pg_config to the $PATH or specify the full executable path with the

10 10.31 option:

10 10.31

10 10.31 python setup.py buildext --pg-config /path/to/pgconfig build …

10 10.31

10 10.31 or with the pg_config option in 'setup.cfg'.

10 10.31

10 10.31 If you prefer to avoid building psycopg2 from source, please install the PyPI

10 10.31 'psycopg2-binary' package instead.

10 10.31

10 10.31 For further information please check the 'doc/src/install.rst' file (also at

10 10.31 ;).

10 10.31

10 10.31 [end of output]

10 10.31

10 10.31 note: This error originates from a subprocess, and is likely not a problem with pip.

10 10.31 error: subprocess-exited-with-error

10 10.31

10 10.31 × Getting requirements to build wheel did not run successfully.

10 10.31 │ exit code: 1

10 10.31 ╰─> See above for output.

10 10.31

10 10.31 note: This error originates from a subprocess, and is likely not a problem with pip.

10 ERROR: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1

View Deploy details

> ⓘ Deployment information is only viewable by project members and Railway employees.

1 Replies

9 months ago

Try adding this nixpacks.toml to your project -

[phases.setup]
    nixPkgs = ['...', 'postgresql']