簡體   English   中英

在cygwin中安裝psycopg2時出錯

[英]Error installing psycopg2 in cygwin

我正在嘗試在cygwin中安裝psycopg2但還沒有成功。 錯誤是: -

Gaurav@gauravpc ~/FieldAgentWeb/FieldAgentWeb
$ easy_install psycopg2
Searching for psycopg2
Reading http://pypi.python.org/simple/psycopg2/
Reading http://initd.org/psycopg/
Reading http://initd.org/projects/psycopg2
Best match: psycopg2 2.4.2
Downloading http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.2.tar.gz
Processing psycopg2-2.4.2.tar.gz
Running psycopg2-2.4.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-QBYpxH
/psycopg2-2.4.2/egg-dist-tmp-gcLa5F
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'.
error: Directory not empty <built-in function rmdir> /tmp/easy_install-QBYpxH/ps
ycopg2-2.4.2/tests

之后,我試圖獲得d pg_config文件,但無法在網上找到它。

我今天設法安裝了psycopg2而沒有安裝windows PostgreSQL(在我的情況下,db已經在另一台服務器中設置了,我只需要用一個依賴於psycopg2的python包連接它,所以完整安裝它不是對我來說是必要的)。

找不到pg_config可執行文件后 ,從cygwin安裝程序我安裝了postgresql-devel libpq-dev (那些應該是必要的,對於記錄我也安裝了很多其他相對於postgresql的包,比如postgresql-client,postgresql-plpython和libpq5)。

之后我可以成功運行pip install psycopg2

pg_config是PostgreSQL安裝的一部分。 它位於本地安裝的bin目錄中(例如C:\\ Program Files(x86)\\ PostgreSQL \\ 9.0 \\ bin)。 將該目錄添加到搜索路徑並嘗試再次構建。

暫無
暫無

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

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