在mac上安装psycopg2时出错

问题描述 投票:0回答:1

当我尝试使用pip install -r requirements.txt在mac上安装psycopg2时出现错误。

Collecting psycopg2==2.6 (from -r requirements.txt (line 30))
Using cached psycopg2-2.6.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: could not determine PostgreSQL version from '10.1'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/r6/0rwq93rx6n59lbn8jrng11gm0000gn/T/pip-build-hat1f3jy/psycopg2/

我无法解决它.python3.4.3 mac10.12有人可以建议任何解决方案吗?

django macos python-3.4
1个回答
0
投票

您遇到的问题是psycopg2与Postgres 10不兼容,除非您使用的是2.7或更高版本。

因此,要么您需要安装早期版本的postgres,要么将您尝试安装的软件包安装到psycopg2 2.7.x

在2.7版本中解决的相关问题可以在这里找到https://github.com/psycopg/psycopg2/issues/489

© www.soinside.com 2019 - 2024. All rights reserved.