在 Heroku 上部署 Django 应用程序。在heroku上推送应用程序时出现错误

时间:2021-07-09 18:36:11

标签: django heroku

我的 Django 应用程序在 localhost 中运行良好,但是当我使用 Git Bash 终端将它推送到 Heroku 时,显示以下错误。什么是 GCC?为什么在 Heroku 上部署时会出现这些错误。是否缺少任何库?

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

remote:          In file included from /app/.heroku/python/include/python3.9/unicodeobject.h:1026,
remote:                           from /app/.heroku/python/include/python3.9/Python.h:106,
remote:                           from ext/_yaml.c:4:
remote:          /app/.heroku/python/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
remote:            446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
remote:                |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
remote:          error: command '/usr/bin/gcc' failed with exit code 1
remote:          ----------------------------------------
remote:          ERROR: Failed building wheel for pyyaml
remote:          Running setup.py clean for pyyaml
remote:          Building wheel for strict-rfc3339 (setup.py): started
remote:          Building wheel for strict-rfc3339 (setup.py): finished with status 'done'
remote:          Created wheel for strict-rfc3339: filename=strict_rfc3339-0.7-py3-none-any.whl size=18119 sha256=169b25d50478fa157faaa6b19e8714b42c42c771ca6926bb2d728a8fe20e9be8
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-wyzbci7g/wheels/25/38/74/7ec7f77ec64b2907430120931ba588b40e6e26f02d4df5be35
remote:          Building wheel for Kivy-Garden (setup.py): started
remote:          Building wheel for Kivy-Garden (setup.py): finished with status 'done'
remote:          Created wheel for Kivy-Garden: filename=Kivy_Garden-0.1.4-py3-none-any.whl size=4532 sha256=daf304aa2ab19ab3786da85313c6fa9ab5a8cdefdc3f854480c9268e519c8bc7
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-wyzbci7g/wheels/19/1b/96/2e2906a93ec4b5d3463b0b803112feab5511a2c37dc07faed3
remote:        Successfully built anyjson css debugger django-responsive2 djangocms-typedjs doctor future mysqlclient psycopg2 PyGreSQL simplejson strict-rfc3339 Kivy-Garden
remote:        Failed to build pyyaml
remote:        Installing collected packages: anyjson, appdirs, asgiref, soupsieve, beautifulsoup4, certifi, chardet, click, colorama, css, debugger, distlib, dj-database-url, pytz, sqlparse, Django, django-appconf, django-crispy-forms, django-appointments, django-bootstrap4, django-classy-tags, django-treebeard, django-sekizai, djangocms-admin-style, django-formtools, django-cms, django-debug-toolbar, whitenoise, psycopg2, django-heroku, six, django-responsive2, Pillow, webencodings, html5lib, djangocms-text-ckeditor, djangocms-typedjs, isodate, jsonschema, pyyaml, rfc3987, simplejson, strict-rfc3339, typing-extensions, mypy-extensions, typing-inspect, doctor, docutils, hpack, hyperframe, h2, hyper, future, iso8601, idna, urllib3, requests, faunadb, filelock, MarkupSafe, Jinja2, itsdangerous, Werkzeug, Flask, gunicorn, zipp, importlib-metadata, Pygments, Kivy-Garden, Kivy, mysqlclient, pycryptodome, PyGreSQL, python-dateutil, python-decouple, virtualenv
remote:            Running setup.py install for pyyaml: started
remote:            Running setup.py install for pyyaml: finished with status 'error'
remote:            ERROR: Command errored out with exit status 1:
remote:             command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qb9qpcl0/pyyaml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qb9qpcl0/pyyaml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-eriq4rxn/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/pyyaml
remote:                 cwd: /tmp/pip-install-qb9qpcl0/pyyaml/

remote:            /app/.heroku/python/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
remote:              446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
remote:                  |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
remote:            error: command '/usr/bin/gcc' failed with exit code 1
remote:            ----------------------------------------
remote:        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-qb9qpcl0/pyyaml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qb9qpcl0/pyyaml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-eriq4rxn/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/pyyaml Check the logs for full command output.
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 49aca9f2998b23aee90d2e557a72ff80fcce7091
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 49aca9f2998b23aee90d2e557a72ff80fcce7091
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to ayyalayurocare.
remote:
To https://git.heroku.com/ayyalayurocare.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ayyalayurocare.git'

我已将 Git Bash 终端与 GitHub 同步。我不知道此错误的确切来源。

0 个答案:

没有答案