无法部署 Heroku 应用程序。 错误:命令出错,退出状态为 1:/app/.heroku/python/bin/python -u -c 'import sys, setuptools, tok



这些都是我得到的错误,我不能张贴整个日志,因为字符限制抱歉。

Building wheel for psycopg2 (setup.py): started
Building wheel for psycopg2 (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mxd65ubh/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mxd65ubh/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-mfz2er96
cwd: /tmp/pip-install-mxd65ubh/psycopg2/

的第二个错误:

psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:689:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
689 |     while (interp->next)
|                  ^~
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Successfully built Pillow
Failed to build psycopg2
Installing collected packages: docutils, jmespath, six, python-dateutil, urllib3, botocore, s3transfer, boto3, certifi, chardet, dj-database-url, pytz, Django, django-crispy-forms, whitenoise, psycopg2, django-heroku, django-storages, gunicorn, idna, Pillow, requests
Running setup.py install for psycopg2: started
Running setup.py install for psycopg2: finished with status 'error'
第三错误:

ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mxd65ubh/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mxd65ubh/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-08ru_8_3/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2
cwd: /tmp/pip-install-mxd65ubh/psycopg2/

psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:689:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
689 |     while (interp->next)
|                  ^~
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mxd65ubh/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mxd65ubh/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-08ru_8_3/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2 Check the logs for full command output.
!     Push rejected, failed to compile Python app.
!     Push failed

这是我的requirements.txt文件
boto3==1.9.96
botocore==1.12.96certifi = = 2018.10.15
chardet = = 3.0.4
dj-database-url = = 0.5.0
Django = = 2.1
django-crispy-forms = = 1.7.2
django-heroku = = 0.3.1
django-storages = = 1.7.1上
docutils = = 0.14
gunicorn = = 19.9.0
idna = = 2.7jmespath = = = = 0.9.3
枕头5.2.0
psycopg2 = = 2.7.7
python-dateutil = = 2.8.0
pytz = = = = 2018.5
请求2.19.1
s3transfer = = 0.2.0
6 = = 1.12.0
urllib3 = = 1.23
whitenoise = = 4.1.2

尝试用pip install psycopg2-binary代替psycopg2安装psycopg2-binary

相关内容

  • 没有找到相关文章

最新更新