【发布时间】:2015-07-28 15:38:08
【问题描述】:
我有 Anaconda Python 3.4,但是每当我运行旧代码时,我都会通过键入“source activate python2”切换到 Anaconda Python 2.7。我的问题是我为 Anaconda Python 3.4 安装了 psycopg2,但没有为 Anaconda Python 2.7 安装。当我运行 pip install psycopg2(在 Python 2.7 上)时,我收到以下消息:
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'.
我是编程新手,需要以下方面的帮助:
1. Obtaining directory containing pg_config
2. Finding the path to Anaconda Python 2.7
3. Adding pg_config to the PATH.
完成这些步骤后,我应该能够 pip install Install psycopg2
【问题讨论】:
标签: python python-2.7 anaconda psql