我在安装psycopg2时遇到问题.我尝试以下时出现以下错误pip install psycopg2:
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'.
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/psycopg2
Run Code Online (Sandbox Code Playgroud)
但问题pg_config实际上是在我的PATH; 它运行没有任何问题:
$ which pg_config
/usr/pgsql-9.1/bin/pg_config
Run Code Online (Sandbox Code Playgroud)
我尝试将pg_config路径添加到该setup.cfg文件并使用我从其网站(http://initd.org/psycopg/)下载的源文件构建它,我收到以下错误消息!
Error: Unable to find 'pg_config' file in '/usr/pgsql-9.1/bin/'
Run Code Online (Sandbox Code Playgroud)
但实际上它就是!!!
我对这些错误感到困惑.有人可以帮忙吗?
顺便说一句,我 …
我正在尝试使用Postgres和Docker构建Flask应用程序.我想连接到Postgres的AWS RDS实例,但是使用Docker作为我的Flask应用程序.但是,当尝试设置psycopg2它时会遇到错误,因为它无法找到pg_config.这是错误:
Building api
Step 1/5 : FROM python:3.6.3-alpine3.6
---> 84c98ca3b5c5
Step 2/5 : WORKDIR /usr/src/app
---> Using cache
---> 407c158f5ee4
Step 3/5 : COPY . .
---> 966df18d329e
Step 4/5 : RUN pip install -r requirements.txt
---> Running in 284cc97aeb63
Collecting aniso8601==1.3.0 (from -r requirements.txt (line 1))
Downloading aniso8601-1.3.0.tar.gz (57kB)
Collecting click==6.7 (from -r requirements.txt (line 2))
Downloading click-6.7-py2.py3-none-any.whl (71kB)
Collecting Flask==0.12.2 (from -r requirements.txt (line 3))
Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
Collecting Flask-RESTful==0.3.6 (from -r requirements.txt …Run Code Online (Sandbox Code Playgroud)