【发布时间】:2021-01-01 03:02:46
【问题描述】:
这是我安装后遇到的错误
运行 pip install -r requirements.txt
RROR:服务“web”构建失败:命令“/bin/sh -c pip install -r requirements.txt”返回非零代码:1 ➜ django-docker pip 安装 psycopg2 默认为用户安装,因为普通站点包不可写 收集 psycopg2 使用缓存的 psycopg2-2.8.6.tar.gz (383 kB) 错误:命令出错,退出状态为 1: 命令:/usr/bin/python3.6 -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7xuxd9cm/psycopg2/setup.py'"'"'; 文件='"'"'/tmp/pip-install-7xuxd9cm/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'" ', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"' "');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip- pip-egg-info-uon18vv4 cwd:/tmp/pip-install-7xuxd9cm/psycopg2/ 完整输出(23 行): 运行 egg_info 创建/tmp/pip-pip-egg-info-uon18vv4/psycopg2.egg-info 写作/tmp/pip-pip-egg-info-uon18vv4/psycopg2.egg-info/PKG-INFO 将dependency_links写入/tmp/pip-pip-egg-info-uon18vv4/psycopg2.egg-info/dependency_links.txt 将顶级名称写入 /tmp/pip-pip-egg-info-uon18vv4/psycopg2.egg-info/top_level.txt 编写清单文件'/tmp/pip-pip-egg-info-uon18vv4/psycopg2.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>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info 检查日志以获取完整的命令输出。
【问题讨论】:
标签: python django docker dockerfile docker-image