u0_a439@localhost: /data/data/com.termux/files/home/storage/shared/z_termux
➜ pip3 install psycopg2-binary我想在上安装内核文件2-二进制文件,但是我遇到了这样的错误.
使用缓存的psycopg2 2-二进制-2.9.3.tar.gz (380 kB)收集内核2-二进制文件
准备元数据(setup.py) ..。错误
错误:子进程-退出-有错误
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running egg_info
creating /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-ayuu7y_q/psycopg2_binary.egg-info
writing /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-ayuu7y_q/psycopg2_binary.egg-info/PKG-INFO
writing dependency_links to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-ayuu7y_q/psycopg2_binary.egg-info/dependency_links.txt
writing top-level names to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-ayuu7y_q/psycopg2_binary.egg-info/top_level.txt
writing manifest file '/data/data/com.termux/files/usr/tmp/pip-pip-egg-info-ayuu7y_q/psycopg2_binary.egg-info/SOURCES.txt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details. /2.4s
u0_a439@localhost: /data/data/com.termux/files/home/storage/shared/z_termux
➜如果有人帮我解决这个问题,我很感激
发布于 2022-03-08 05:54:34
我认为psycopg2-binary包是预先构建的,假设它将运行在使用glibc实现作为标准C库的Linux系统上。Termux运行在不使用glibc的Android上。因此,我认为发生的事情是,pip理解这一点,并返回到从源代码构建内核,在这种情况下,构建依赖应该在安装之前。
尝试安装构建依赖项:
apt-get install libpq-dev gcc python3-dev musl-dev请参阅https://github.com/psycopg/psycopg2/issues/684
对相同问题的web搜索表明,对于其他不使用glibc的Linux系统也是如此,比如Alpine。
https://stackoverflow.com/questions/71390492
复制相似问题