开发者

psycopg2 on cygwin: no such process

开发者 https://www.devze.com 2023-01-01 01:25 出处:网络
I am trying to install postgrepsql to cygwin on a windows 7 machine and want it to work with django.

I am trying to install postgrepsql to cygwin on a windows 7 machine and want it to work with django.

After built and installed postgrepsql in cygwin, I built and installed psycopg2 in cygwin as well and got no error, but when use it in python with cygwin, I got the "no such process" error:

import psycopg2 Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/psycopg2/init.py", line 60, in from _psycopg import BINARY, NUMBER, STRING, DATETI开发者_运维问答ME, ROWID ImportError: No such process

any clues?

Thanks!

Jerry


The no such process error comes about because psycopg2 is looking for cygpq.dll and can't find it.

When you install postgres from source, it puts this .dll in /usr/local/pgsql/lib/

Evidently, cygpq.dll is resolved by the win32 process loader, NOT cygwin or python, so you have to put it somewhere on your Windows path. A good spot is /usr/local/bin.

cp /usr/local/pgsql/lib/cygpq.dll /usr/local/bin/


In my case, I had to reinstall libpq5.


Why? There is native psycopg2 for Win.


you could try these: http://www.stickpeople.com/projects/python/win-psycopg/

0

精彩评论

暂无评论...
验证码 换一张
取 消