簡體   English   中英

在Ubuntu 14.10上安裝psycopg2

[英]Installation of psycopg2 on Ubuntu 14.10

在此處完成新手操作,嘗試將Django設置為可與PostgreSQL一起使用。 我正在使用Ubuntu 14.10,並且還安裝了PostgreSQL 9.5。
當我在終端中運行pip install psycopg2 ,出現以下錯誤:

Collecting psycopg2
Using cached psycopg2-2.6.1.tar.gz
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 dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt

writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

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-la8dJp/psycopg2

我知道包含pg_config的目錄是/opt/PostgreSQL/9.5/bin/pg_config但是我不知道如何將此目錄添加到PATH來安裝我的psycopg2。 或安裝psycopg2的任何其他方法,以便我可以與PostgreSQL進行交互。

預先感謝您。

除非您確實對使用本機postgresql庫有嚴格要求,否則我建議您改用pg8000庫,因為該庫是純python。

自從幾年前發現它以來,我就停止使用另一個,而忘記了必須在這么多平台上進行編譯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM