问题描述
这是我安装后收到的错误
运行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'导入sys,setuptools,令牌化; sys.argv [0] ='“'”'/tmp/pip-install-7xuxd9cm/psycopg2/setup.py'“'”'; 文件 ='“'”'/ tmp / pip-install-7xuxd9cm / psycopg2 / setup.py'“'”'; f = getattr(tokenize,'“'”'open'“'” ',打开)(文件);代码= 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 @R_785_4045@ion please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
----------------------------------------
错误:命令错误,退出状态1:python setup.py egg_info检查日志以获取完整的命令输出。
解决方法
错误可能是由psycopy2-binary>==2.8
上的错误运算符引起的,根据pip docs,该运算符应为>=
而不是>==
这可能会导致在解析需求文件时出错。