我正在使用virtualenv
,我需要安装"psycopg2".
我做了以下事情:
pip install http://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
Run Code Online (Sandbox Code Playgroud)
我有以下消息:
Downloading/unpacking http://pypi.python.org/packages/source/p/psycopg2/psycopg2
-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
Downloading psycopg2-2.4.tar.gz (607Kb): 607Kb downloaded
Running setup.py egg_info for package from http://pypi.python.org/packages/sou
rce/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
Error: pg_config executable not found.
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'.
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\psycopg2.egg-info
writing pip-egg-info\psycopg2.egg-info\PKG-INFO
writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt
writing …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用psycopg2与sslmode ='required'参数连接到我的postgres数据库; 但是,我收到以下错误
psycopg2.OperationalError: sslmode value "require" invalid when SSL support is not compiled in
Run Code Online (Sandbox Code Playgroud)
这是关于我的系统的几个细节
这是我试图解决问题的方法
brew uninstall python
which python
仍然显示python生活在/usr/local/bin/python
,试图卸载这个但不能.并且听说这是操作系统使用的python,不管怎么说都不应该卸载brew install python --with-brewed-openssl --build-from-source
pip uninstall psycopg2
pip install psycopg2
完成所有这些后,异常仍然发生.我通过运行这个python脚本#!/usr/bin/env python
不知道它的问题,但是这是一个不同的目录比一个which python
节目