首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在termux上安装心理学2-二进制文件失败/出错

在termux上安装心理学2-二进制文件失败/出错
EN

Stack Overflow用户
提问于 2022-03-08 05:38:36
回答 1查看 2.7K关注 0票数 1
代码语言:javascript
复制
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) ..。错误

错误:子进程-退出-有错误

代码语言:javascript
复制
  × 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
➜

如果有人帮我解决这个问题,我很感激

EN

回答 1

Stack Overflow用户

发布于 2022-03-08 05:54:34

我认为psycopg2-binary包是预先构建的,假设它将运行在使用glibc实现作为标准C库的Linux系统上。Termux运行在不使用glibc的Android上。因此,我认为发生的事情是,pip理解这一点,并返回到从源代码构建内核,在这种情况下,构建依赖应该在安装之前。

尝试安装构建依赖项:

代码语言:javascript
复制
apt-get install libpq-dev gcc python3-dev musl-dev

请参阅https://github.com/psycopg/psycopg2/issues/684

对相同问题的web搜索表明,对于其他不使用glibc的Linux系统也是如此,比如Alpine。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71390492

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档