1

I'm trying to deploy my Django web app, however, vercel is giving me this error when it failed to deploy:

Failed to run "pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/workout_log/requirements.txt"
Error: Command failed: pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/workout_log/requirements.txt
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      /tmp/pip-build-env-q1jqann4/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`

Here is my requirments.txt file:

asgiref==3.6.0
beautifulsoup4==4.12.0
certifi==2022.12.7
charset-normalizer==3.1.0
dj-database-url==1.2.0
Django==4.1.4
django-bootstrap4==22.3
django-environ==0.10.0
django-heroku==0.3.1
gunicorn==20.1.0
heroku==0.1.4
idna==3.4
psycopg2==2.9.5
psycopg2-binary==2.9.6
python-dateutil==1.5
requests==2.28.2
soupsieve==2.4
sqlparse==0.4.3
tzdata==2022.7
urllib3==1.26.15
whitenoise==6.4.0

I tried to use Python 3.9 to fix the problem. I also tried to run this command on my local environment, but it said that pip3.9 is not a recognized command.

toyota Supra
  • 3,181
  • 4
  • 15
  • 19
Aysmith17
  • 13
  • 3

2 Answers2

0

I don't know if this will fix it, but I believe it is supposed to be psycopg2-binary~=2.9.6 and I don't know if psycopg2==2.9.5 is necessary. Try that and see if it works.

Tablesalt
  • 11
  • 3
0

Using psycopg2-binary~=2.9.6 works for django deployments on Vercel. It may be due to lack of native postgres support on vercel systems, for which reason we have to directly add psycopg2-binary~=2.9.6 to requirements.txt.