我正在使用macos,并试图将我的web应用程序部署到heroku上,但始终失败 build wheel for psycopg2
. 我已经尝试了所有方法——我发现这篇文章很有用:如何在python上安装带有“pip”的psycopg2?
但是,即使尝试了所有方法,车轮仍然无法制造。
以下是一些有帮助的错误消息:
psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
685 | 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 alembic blinker dominate Flask-Bootstrap Flask-Mail guess-language-spirit itsdangerous Mako python-editor visitor WTForms
Failed to build psycopg2
Installing collected packages: SQLAlchemy, MarkupSafe, Mako, python-editor, six, python-dateutil, alembic, pytz, Babel, blinker, certifi, chardet, click, dnspython, dominate, urllib3, elasticsearch, idna, email-validator, itsdangerous, Jinja2, Werkzeug, Flask, Flask-Babel, visitor, Flask-Bootstrap, Flask-Login, Flask-Mail, Flask-SQLAlchemy, Flask-Migrate, Flask-Moment, WTForms, Flask-WTF, guess-language-spirit, PyJWT, python-dotenv, requests, psycopg2, gunicorn
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-nqnkr57w/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nqnkr57w/psycopg2/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-u2t7aq2l/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2
cwd: /tmp/pip-install-nqnkr57w/psycopg2/
psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
685 | 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-nqnkr57w/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nqnkr57w/psycopg2/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-u2t7aq2l/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2 Check the logs for full command output.
1条答案
按热度按时间rjjhvcjd1#
也许您的平台不符合构建它的要求。您也可以安装独立二进制文件
你可以在这里阅读更多信息:文档