我有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'.
Run Code Online (Sandbox Code Playgroud)
我对编程很新,需要帮助:
1. Obtaining directory containing pg_config
2. Finding the path to Anaconda Python 2.7
3. Adding pg_config to the PATH.
Run Code Online (Sandbox Code Playgroud)
完成这些步骤后,我应该能够安装安装psycopg2