heroku 错误:命令'/usr/bin/gcc'失败,退出代码为1

dnph8jn4  于 2022-11-24  发布在  其他
关注(0)|答案(1)|浏览(212)

我在Windows 10中使用Visual Studion。在添加了runtime.txt(python-3.10.8)和requirements.txt文件后,我第一次尝试使用“git push heroku master”将Flask应用程序部署到heroku 22,但随后出现了如上所述的错误。
我有一个txt文件,其中包含命令的完整输出。如果需要附加,请告诉我。
错误的开始:

Counting objects: 100% (1268/1268), done.
Delta compression using up to 12 threads
Compressing objects: 100% (683/683), done.
Writing objects: 100% (1268/1268), 25.72 MiB | 136.00 KiB/s, done.
Total 1268 (delta 582), reused 1233 (delta 567), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-22 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote: -----> Installing python-3.10.8
remote: -----> Installing pip 22.3.1, setuptools 63.4.3 and wheel 0.37.1
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting beautifulsoup4==4.8.1
remote:          Downloading beautifulsoup4-4.8.1-py3-none-any.whl (101 kB)
remote:        Collecting cffi==1.12.3
remote:          Downloading cffi-1.12.3.tar.gz (456 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting Click==7.0
remote:          Downloading Click-7.0-py2.py3-none-any.whl (81 kB)
remote:        Collecting Cython>=0.29.32
remote:          Downloading Cython-0.29.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (1.9 MB)
remote:        Collecting dnspython==1.16.0
remote:          Downloading dnspython-1.16.0-py2.py3-none-any.whl (188 kB)
remote:        Collecting et-xmlfile==1.0.1
remote:          Downloading et_xmlfile-1.0.1.tar.gz (8.4 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting eventlet==0.25.0
remote:          Downloading eventlet-0.25.0-py2.py3-none-any.whl (222 kB)
remote:        Collecting Flask==1.0.2
remote:          Downloading Flask-1.0.2-py2.py3-none-any.whl (91 kB)
remote:        Collecting Flask-Caching==1.7.2
remote:          Downloading Flask_Caching-1.7.2-py2.py3-none-any.whl (27 kB)
remote:        Collecting Flask-Compress==1.4.0
remote:          Downloading Flask-Compress-1.4.0.tar.gz (6.0 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting Flask-LazyViews==0.6
remote:          Downloading Flask-LazyViews-0.6.tar.gz (5.4 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting Flask-SocketIO==4.1.0
remote:          Downloading Flask_SocketIO-4.1.0-py2.py3-none-any.whl (16 kB)
remote:        Collecting Flask-SQLAlchemy==2.3.2
remote:          Downloading Flask_SQLAlchemy-2.3.2-py2.py3-none-any.whl (16 kB)
remote:        Collecting Flask-Static-Compress==1.0.2
remote:          Downloading Flask-Static-Compress-1.0.2.tar.gz (5.1 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting flaskwebgui>=1.0.1
remote:          Downloading flaskwebgui-1.0.1-py3-none-any.whl (6.4 kB)
remote:        Collecting gevent==1.4.0
remote:          Downloading gevent-1.4.0.tar.gz (5.2 MB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting greenlet==0.4.15
remote:          Downloading greenlet-0.4.15.tar.gz (59 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting gunicorn==18.0
remote:          Downloading gunicorn-18.0-py33-none-any.whl (93 kB)
remote:        Collecting itsdangerous==1.1.0
remote:          Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
remote:        Collecting jac==0.17.2
remote:          Downloading jac-0.17.2-py2.py3-none-any.whl (17 kB)
remote:        Collecting jdcal==1.4
remote:          Downloading jdcal-1.4-py2.py3-none-any.whl (9.5 kB)
remote:        Collecting Jinja2==2.10
remote:          Downloading Jinja2-2.10-py2.py3-none-any.whl (126 kB)
remote:        Collecting MarkupSafe==1.1.0
remote:          Downloading MarkupSafe-1.1.0.tar.gz (18 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting monotonic==1.5
remote:          Downloading monotonic-1.5-py2.py3-none-any.whl (5.3 kB)
remote:        Collecting openpyxl==2.5.12
remote:          Downloading openpyxl-2.5.12.tar.gz (173 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting ordereddict==1.1
remote:          Downloading ordereddict-1.1.tar.gz (2.1 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting passlib==1.7.1
remote:          Downloading passlib-1.7.1-py2.py3-none-any.whl (498 kB)
remote:        Collecting psutil>=5.9.4
remote:          Downloading psutil-5.9.4-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280 kB)
remote:        Collecting pycparser==2.19
remote:          Downloading pycparser-2.19.tar.gz (158 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting pymssql>=2.1.4
remote:          Downloading pymssql-2.2.6-cp310-cp310-manylinux_2_24_x86_64.whl (3.2 MB)
remote:        Collecting python-engineio==3.9.3
remote:          Downloading python_engineio-3.9.3-py2.py3-none-any.whl (119 kB)
remote:        Collecting python-socketio==4.3.1
remote:          Downloading python_socketio-4.3.1-py2.py3-none-any.whl (49 kB)
remote:        Collecting redis==3.3.8
remote:          Downloading redis-3.3.8-py2.py3-none-any.whl (66 kB)
remote:        Collecting rjsmin==1.1.0
remote:          Downloading rjsmin-1.1.0.tar.gz (412 kB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting rq==1.1.0
remote:          Downloading rq-1.1.0-py2.py3-none-any.whl (55 kB)
remote:        Collecting six==1.12.0
remote:          Downloading six-1.12.0-py2.py3-none-any.whl (10 kB)
remote:        Collecting soupsieve==1.9.4
remote:          Downloading soupsieve-1.9.4-py2.py3-none-any.whl (33 kB)
remote:        Collecting SpeechRecognition==3.8.1
remote:          Downloading SpeechRecognition-3.8.1-py2.py3-none-any.whl (32.8 MB)
remote:        Collecting SQLAlchemy==1.2.16
remote:          Downloading SQLAlchemy-1.2.16.tar.gz (5.7 MB)
remote:          Preparing metadata (setup.py): started
remote:          Preparing metadata (setup.py): finished with status 'done'
remote:        Collecting Werkzeug==0.14.1
remote:          Downloading Werkzeug-0.14.1-py2.py3-none-any.whl (322 kB)
remote:        Collecting whichcraft==0.6.1
remote:          Downloading whichcraft-0.6.1-py2.py3-none-any.whl (5.2 kB)
remote:        Collecting XlsxWriter==1.1.2
remote:          Downloading XlsxWriter-1.1.2-py2.py3-none-any.whl (142 kB)
remote:        Building wheels for collected packages: cffi, et-xmlfile, Flask-Compress, Flask-LazyViews, Flask-Static-Compress, gevent, greenlet, MarkupSafe, openpyxl, ordereddict, pycparser, rjsmin, SQLAlchemy
remote:          Building wheel for cffi (setup.py): started
remote:          Building wheel for cffi (setup.py): finished with status 'error'
remote:          error: subprocess-exited-with-error
remote:
remote:          × python setup.py bdist_wheel did not run successfully.
remote:          │ exit code: 1
remote:          ╰─> [58 lines of output]
remote:              /app/.heroku/python/lib/python3.10/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
remote:                warnings.warn(msg, warning_class)
remote:              running bdist_wheel
remote:              running build
remote:              running build_py
remote:              creating build
remote:              creating build/lib.linux-x86_64-cpython-310
remote:              creating build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/lock.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/recompiler.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/verifier.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/pkgconfig.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/commontypes.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/vengine_gen.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/api.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/ffiplatform.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/model.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/__init__.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/error.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/cparser.py -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/_cffi_include.h -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/parse_c_type.h -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/_embedding.h -> build/lib.linux-x86_64-cpython-310/cffi
remote:              copying cffi/_cffi_errors.h -> build/lib.linux-x86_64-cpython-310/cffi
remote:              running build_ext
remote:              building '_cffi_backend' extension
remote:              creating build/temp.linux-x86_64-cpython-310
remote:              creating build/temp.linux-x86_64-cpython-310/c
remote:              gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/app/.heroku/python/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-cpython-310/c/_cffi_backend.o
remote:              c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
remote:              c/_cffi_backend.c:405:23: error: lvalue required as left operand of assignment
remote:                405 |         Py_REFCNT(ct) = 43;
remote:                    |                       ^
remote:              c/_cffi_backend.c:408:23: error: lvalue required as left operand of assignment
remote:                408 |         Py_REFCNT(ct) = 0;
remote:                    |                       ^
remote:              c/_cffi_backend.c: In function ‘prepare_callback_info_tuple’:
remote:              c/_cffi_backend.c:6029:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
remote:               6029 |     PyEval_InitThreads();
remote:                    |     ^~~~~~~~~~~~~~~~~~
remote:              In file included from /app/.heroku/python/include/python3.10/Python.h:130,
remote:                               from c/_cffi_backend.c:2:
remote:              /app/.heroku/python/include/python3.10/ceval.h:122:37: note: declared here
remote:                122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
remote:                    |                                     ^~~~~~~~~~~~~~~~~~
remote:              c/_cffi_backend.c: In function ‘b_callback’:
remote:              c/_cffi_backend.c:6089:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]
remote:               6089 |     if (ffi_prep_closure(closure, &cif_descr->cif,
remote:                    |     ^~
remote:              In file included from c/_cffi_backend.c:15:
remote:              /usr/include/x86_64-linux-gnu/ffi.h:347:1: note: declared here
remote:                347 | ffi_prep_closure (ffi_closure*,
remote:                    | ^~~~~~~~~~~~~~~~
remote:              error: command '/usr/bin/gcc' failed with exit code 1
remote:              [end of output]
remote:
remote:          note: This error originates from a subprocess, and is likely not a problem with pip.
remote:          ERROR: Failed building wheel for cffi
remote:          Running setup.py clean for cffi
remote:          Building wheel for et-xmlfile (setup.py): started
remote:          Building wheel for et-xmlfile (setup.py): finished with status 'done'
remote:          Created wheel for et-xmlfile: filename=et_xmlfile-1.0.1-py3-none-any.whl size=8899 sha256=b2708efaa45a5f5da14642498f699b611fbe115e125fac2d922874c35465e585
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-kkql_md1/wheels/55/c8/cb/3d7a32568ad6c531c9e52fa6a5c38eaf0a7593f9295ea845d0
remote:          Building wheel for Flask-Compress (setup.py): started
remote:          Building wheel for Flask-Compress (setup.py): finished with status 'done'
remote:          Created wheel for Flask-Compress: filename=Flask_Compress-1.4.0-py3-none-any.whl size=3724 sha256=563e55c16a2e4015b6140b5a40858f728d6db5d8d889cd777c48f68d50474ade
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-kkql_md1/wheels/58/db/74/1d0e07b78f261ac9af019d6ca6f342beeff7597181d54fff28
remote:          Building wheel for Flask-LazyViews (setup.py): started
remote:          Building wheel for Flask-LazyViews (setup.py): finished with status 'done'
remote:          Created wheel for Flask-LazyViews: filename=Flask_LazyViews-0.6-py3-none-any.whl size=6118 sha256=9fd587901c1ed2269e00a9340b733a2099c14d5003e3e9097247f59b25733aa4
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-kkql_md1/wheels/21/f2/49/4ff57ece0c20a5b598e6673e4ac619b099275b26e010f34110
remote:          Building wheel for Flask-Static-Compress (setup.py): started
remote:          Building wheel for Flask-Static-Compress (setup.py): finished with status 'done'
remote:          Created wheel for Flask-Static-Compress: filename=Flask_Static_Compress-1.0.2-py3-none-any.whl size=5081 sha256=dd3df06394da012ea8704488bebab76d7b0e49d29805529d4e35b13bf0215d61
remote:          Stored in directory: /tmp/pip-ephem-wheel-cache-kkql_md1/wheels/31/e8/ea/b41f34fb711574243683aadd1b7848e0c40889cba929b058ad
remote:          Building wheel for gevent (setup.py): started
remote:          Building wheel for gevent (setup.py): finished with status 'error'
remote:          error: subprocess-exited-with-error
remote:
remote:          × python setup.py bdist_wheel did not run successfully.
remote:          │ exit code: 1
remote:          ╰─> [1783 lines of output]
remote:              /app/.heroku/python/lib/python3.10/site-packages/setuptools/_distutils/dist.py:262: UserWarning: Unknown distribution option: 'cffi_modules'
remote:                warnings.warn(msg)
remote:              running bdist_wheel
remote:              running build
remote:              running build_py
remote:              creating build
remote:              creating build/lib.linux-x86_64-cpython-310
remote:              creating build/lib.linux-x86_64-cpython-310/gevent
remote:          × Running setup.py install for greenlet did not run successfully.
remote:          │ exit code: 1
remote:          ╰─> [44 lines of output]
remote:              running install
remote:              /app/.heroku/python/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
remote:                warnings.warn(
remote:              running build
remote:              running build_ext
remote:              building 'greenlet' extension
remote:              creating build
remote:              creating build/temp.linux-x86_64-cpython-310
remote:              gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/app/.heroku/python/include/python3.10 -c greenlet.c -o build/temp.linux-x86_64-cpython-310/greenlet.o
remote:              greenlet.c: In function ‘g_calltrace’:
remote:              greenlet.c:538:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?
remote:                538 |         tstate->use_tracing = 0;
remote:                    |                 ^~~~~~~~~~~
remote:                    |                 tracing
remote:              greenlet.c:541:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?
remote:                541 |         tstate->use_tracing = (tstate->tracing <= 0 &&
remote:                    |                 ^~~~~~~~~~~
remote:                    |                 tracing
remote:              greenlet.c: In function ‘g_initialstub’:
remote:              greenlet.c:823:25: warning: ‘PyEval_CallObjectWithKeywords’ is deprecated [-Wdeprecated-declarations]
remote:                823 |                         result = PyEval_CallObjectWithKeywords(
remote:                    |                         ^~~~~~
remote:              In file included from /app/.heroku/python/include/python3.10/Python.h:130,
remote:                               from greenlet.h:8,
remote:                               from greenlet.c:5:
remote:              /app/.heroku/python/include/python3.10/ceval.h:17:43: note: declared here
remote:                 17 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
remote:                    |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
remote:              greenlet.c: In function ‘green_dealloc’:
remote:              greenlet.c:1009:33: error: lvalue required as left operand of assignment
remote:               1009 |                 Py_REFCNT(self) = 1;
remote:                    |                                 ^
remote:              greenlet.c:1038:21: error: lvalue required as decrement operand
remote:               1038 |                 if (--Py_REFCNT(self) != 0) {
remote:                    |                     ^~
remote:              greenlet.c:1042:41: error: lvalue required as left operand of assignment
remote:               1042 |                         Py_REFCNT(self) = refcnt;
remote:                    |                                         ^
remote:              greenlet.c:1046:25: error: ‘_Py_DEC_REFTOTAL’ undeclared (first use in this function); did you mean ‘_Py_DECREF’?
remote:               1046 |                         _Py_DEC_REFTOTAL;
remote:                    |                         ^~~~~~~~~~~~~~~~
remote:                    |                         _Py_DECREF
remote:              greenlet.c:1046:25: note: each undeclared identifier is reported only once for each function it appears in
remote:              error: command '/usr/bin/gcc' failed with exit code 1
remote:              [end of output]
remote:
remote:          note: This error originates from a subprocess, and is likely not a problem with pip.
remote:        error: legacy-install-failure
remote:
remote:        × Encountered error while trying to install package.
remote:        ╰─> greenlet
remote:
remote:        note: This is an issue with the package mentioned above, not pip.
remote:        hint: See above for output from the failure.
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to shopfloortrackers.
remote:
To https://git.heroku.com/shopfloortrackers.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/shopfloortrackers.git'
798qvoo8

798qvoo81#

有一堆像greenlet这样的软件包丢失了,还有像wheel这样的过时的软件包,我首先需要解决这个问题。现在我的程序能够成功部署了。

相关问题