我正在尝试在 Heroku 上部署 DRF 应用程序,但在为 uWSGI 构建轮子时它一直出错。 我在 Heroku 堆栈上:Heroku-20 最新版
命令行上的日志是这样的:
remote: Building wheel for uWSGI (setup.py): started
remote: Building wheel for uWSGI (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-_2lmfods/uWSGI/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_2lmfods/uWSGI/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-8jh6k5it
remote: cwd: /tmp/pip-install-_2lmfods/uWSGI/
remote: Complete output (221 lines):
remote: /app/.heroku/python/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'descriptions'
remote: warnings.warn(msg)
remote: running bdist_wheel
完整的命令行登录太长,无法在此处发布。但是在日志的更下方有这个警告:
remote: plugins/python/python_plugin.c: In function ‘uwsgi_python_worker’:
remote: plugins/python/python_plugin.c:1961:3: warning: ‘PyOS_AfterFork’ is deprecated [-Wdeprecated-declarations]
remote: 1961 | PyOS_AfterFork();
remote: | ^~~~~~~~~~~~~~
remote: In file included from /app/.heroku/python/include/python3.8/Python.h:144,
remote: from plugins/python/uwsgi_python.h:2,
remote: from plugins/python/python_plugin.c:1:
remote: /app/.heroku/python/include/python3.8/intrcheck.h:18:37: note: declared here
remote: 18 | Py_DEPRECATED(3.7) PyAPI_FUNC(void) PyOS_AfterFork(void);
我的初始运行时 python 是 3.9.0,我已经测试将其更改为 3.9.2 和 3.8.8,但仍然出现相同的错误。
最近有没有其他人在使用 Heroku 时遇到过这个问题?