pip - 根据错误日志为 psycopg2-“pip”问题构建轮子时出错?
问题描述
我一直在尝试安装psycopg2
一段时间,但每次遇到ERROR: Failed building wheel for psycopg2
.
我已经写信给维护 psycopg2 的人,他说这是个pip
问题;请在此处查看简短的会议:https ://github.com/psycopg/psycopg2/issues/1331
以下是错误日志:
remote: Building wheel for psycopg2 (setup.py): started
remote: Building wheel for psycopg2 (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-gtbzh5wa/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gtbzh5wa/psycopg2/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-lr6q7nda
remote: cwd: /tmp/pip-install-gtbzh5wa/psycopg2/
remote: psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
remote: psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
remote: 685 | while (interp->next)
remote: | ^~
remote: error: command '/usr/bin/gcc' failed with exit code 1
remote: ----------------------------------------
remote: ERROR: Failed building wheel for psycopg2
remote: Running setup.py clean for psycopg2
remote: Successfully built alembic blinker dominate Flask-Bootstrap Flask-Mail guess-language-spirit itsdangerous Mako python-editor visitor WTForms
remote: Failed to build psycopg2
remote: 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, Jinja2, itsdangerous, 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
remote: Running setup.py install for psycopg2: started
remote: Running setup.py install for psycopg2: 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-gtbzh5wa/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gtbzh5wa/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-w8vdwemp/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2
remote: cwd: /tmp/pip-install-gtbzh5wa/psycopg2/
remote: psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
remote: psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
remote: 685 | while (interp->next)
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-gtbzh5wa/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gtbzh5wa/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-w8vdwemp/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2 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: 051cab19b48ea2b11b7471f753d7d88b06c0030d
remote: !
remote: ! We have detected that you have triggered a build from source code with version 051cab19b48ea2b11b7471f753d7d88b06c0030d
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 patrickchong-blog.
remote:
To https://git.heroku.com/patrickchong-blog.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/patrickchong-blog.git'
解决方案
推荐阅读
- c - 如何在没有指针的情况下存储变量的地址
- windows - 从 Linux VM 切换到 Windows VM docker toolbox windows 8.1
- apache-spark - 如何在一个微批量的 Spark 结构化流中设置批量大小
- arrays - 如何在Swift中删除除第一个/最后n个元素之外的所有数组项
- javascript - 未捕获的类型错误:无法读取 HTMLTableCellElement 处未定义的属性“样式”
- android - 如何使用 b4a 在 android 11(范围存储)中获得“所有文件访问”或“对文件夹的永久和完全访问”?
- javascript - 将 HTML 复制到剪贴板
- c - 用递归计算布尔表达式
- c# - 类库中的 C# 数据上下文
- cakephp - 按计数关联数据过滤查询 CakePHP 3