a year ago
Preparing metadata (setup.py): finished with status 'error'
10 9.357 error: subprocess-exited-with-error
10 9.357
10 9.357 × python setup.py egg_info did not run successfully.
10 9.357 │ exit code: 1
10 9.357 ╰─> [23 lines of output]
10 9.357 running egg_info
10 9.357 creating /tmp/pip-pip-egg-info-8a2u3_r3/psycopg2.egg-info
10 9.357 writing /tmp/pip-pip-egg-info-8a2u3_r3/psycopg2.egg-info/PKG-INFO
10 9.357 writing dependencylinks to /tmp/pip-pip-egg-info-8a2u3r3/psycopg2.egg-info/dependency_links.txt
10 9.357 writing top-level names to /tmp/pip-pip-egg-info-8a2u3r3/psycopg2.egg-info/toplevel.txt
10 9.357 writing manifest file '/tmp/pip-pip-egg-info-8a2u3_r3/psycopg2.egg-info/SOURCES.txt'
10 9.357
10 9.357 Error: pg_config executable not found.
10 9.357
10 9.357 pg_config is required to build psycopg2 from source. Please add the directory
10 9.357 containing pg_config to the $PATH or specify the full executable path with the
10 9.357 option:
10 9.357
10 9.357 python setup.py buildext --pg-config /path/to/pgconfig build …
10 9.357
10 9.357 or with the pg_config option in 'setup.cfg'.
10 9.357
10 9.357 If you prefer to avoid building psycopg2 from source, please install the PyPI
10 9.357 'psycopg2-binary' package instead.
10 9.357
10 9.357 For further information please check the 'doc/src/install.rst' file (also at
10 9.357 ;).
10 9.357
10 9.357 [end of output]
I'm trying to upload my application to railway, I did everything right, but where am I getting an error with installing the psycopg2 package? My requrements.txt file does not have this library when I push to git.
Here is my file
asgiref==3.7.2
dj-database-url==2.1.0
Django==5.0.2
django-cors-headers==4.3.1
django-heroku==0.3.1
djangorestframework==3.14.0
djangorestframework-simplejwt==5.3.1
gunicorn==21.2.0
packaging==24.0
psycopg2-binary==2.9.9
PyJWT==2.8.0
pytz==2024.1
sqlparse==0.4.4
typing_extensions==4.10.0
tzdata==2024.1
whitenoise==6.6.0
> ⓘ Deployment information is only viewable by Project members and Railway admins.
7 Replies
a year ago
I actually use psycopg2-binary, as the error says
a year ago
Then it's likely you are still trying to install the non binary version.
How to install the required version? What do I need to change?
a year ago
Remove the non binary version, or anything that is installing it, from your requirements.txt
Status changed to Solved railway[bot] • about 1 year ago
a year ago
Remove the non binary version from your requirements.txt
I removed all versions from the file psycopg2 and
psycopg2-binary
The error is still the same
a year ago
Please attach your full build logs - https://bookmarklets.up.railway.app/log-downloader/
I finally got it! Everything is working. Thank you. The problem was that I had the heroku library in the requirements.txt, and when you install it, psycopg is loaded along with it