gpt4 book ai didi

postgresql - 在 aws(ubuntu) 中安装 psycopg2 时出错,如何解决?

转载 作者:行者123 更新时间:2023-12-04 19:08:43 27 4
gpt4 key购买 nike

Collecting psycopg2 Using cached psycopg2-2.8.5.tar.gz (380 kB) 
ERROR: Command errored out with exit status 1: command: /home/ubuntu/egrdb/env/bin/python -c 'import sys, setuptools, tokenize; sys.argv0 = '"'"'/tmp/pip-install-gn70jweq/psycopg2/setup.py'"'"'; file='"'"'/tmp/pip-install-gn70jweq/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-4tr67ll8 cwd: /tmp/pip-install-gn70jweq/psycopg2/ Complete output (7 lines): running egg_info creating /tmp/pip-pip-egg-info-4tr67ll8/psycopg2.egg-info writing /tmp/pip-pip-egg-info-4tr67ll8/psycopg2.egg-info/PKG-INFO writing dependency_links to /tmp/pip-pip-egg-info-4tr67ll8/psycopg2.egg-info/dependency_links.txt writing top-level names to /tmp/pip-pip-egg-info-4tr67ll8/psycopg2.egg-info/top_level.txt writing manifest file '/tmp/pip-pip-egg-info-4tr67ll8/psycopg2.egg-info/SOURCES.txt' Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'

----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

最佳答案

如果你想安装源版本 psycopg2-2.8.5.tar.gz 那么你需要按照@Chris 说的做。更简单的方法是:pip install psycopg2-binary然后你得到一个预编译的版本,你不需要 -dev 包。

关于postgresql - 在 aws(ubuntu) 中安装 psycopg2 时出错,如何解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62499562/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com