Re: installing under windows and python2.6

Dietmar Schwertberger <[email protected]> Tue, 03 Feb 2009 22:06:44 +0100
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Hello Ted,

not too much traffic on this list any more.
I don't think that pyPgSQL is maintained any more or that it makes sense 
to report any bugs.
It's a pity, because I'm also still using pyPgSQL.


I don't use Python 2.6, but 2.5, so I can't provide a binary.


You probably don't have pg_config in the path and also did not edit 
setup.py with your include directory.
You need to tell setup.py where to find the PostgreSQL include files.
For my installation the automatic approach also did not work because the 
bin directory is not in the path and so I had to add the paths manually:

     include_dirs = [os.popen("pg_config --includedir").read().strip()] 
+ [r"C:\Program Files\PostgreSQL\8.3\include"]
     library_dirs = [os.popen("pg_config --libdir").read().strip()] + 
[r"C:\Program Files\PostgreSQL\8.3\lib"]


I've pasted below the resulting output from "python.exe setup.py install".

When you're using pyPgSQL, check your PostgreSQL log file for any 
warnings regarding (un)escaped characters.
I've just modified my PgSQL.py module to add an "E" before any escaped 
string:

class PgBytea:
[...]
     def _quote(self, forArray=0):
	if self.value:
	    return "E"+PgQuoteBytea(self.value, forArray)
	return 'NULL'
[...]
def _quote(value, forProc=False):
[...]
     elif isinstance(value, StringType):
	return "E"+PgQuoteString(value)


Regards,

Dietmar



running install
running build
running build_py
running build_ext
running install_lib
creating J:\Python25\Lib\site-packages\pyPgSQL
copying build\lib.win32-2.5\pyPgSQL\PgSQL.py -> 
J:\Python25\Lib\site-packages\py
PgSQL
copying build\lib.win32-2.5\pyPgSQL\__init__.py -> 
J:\Python25\Lib\site-packages
\pyPgSQL
creating J:\Python25\Lib\site-packages\pyPgSQL\libpq
copying build\lib.win32-2.5\pyPgSQL\libpq\__init__.py -> 
J:\Python25\Lib\site-pa
ckages\pyPgSQL\libpq
copying build\lib.win32-2.5\pyPgSQL\libpq\libpq.pyd -> 
J:\Python25\Lib\site-pack
ages\pyPgSQL\libpq
byte-compiling J:\Python25\Lib\site-packages\pyPgSQL\PgSQL.py to PgSQL.pyc
byte-compiling J:\Python25\Lib\site-packages\pyPgSQL\__init__.py to 
__init__.pyc

byte-compiling J:\Python25\Lib\site-packages\pyPgSQL\libpq\__init__.py 
to __init
__.pyc
running install_egg_info
Removing J:\Python25\Lib\site-packages\pyPgSQL-2.5.1-py2.5.egg-info
Writing J:\Python25\Lib\site-packages\pyPgSQL-2.5.1-py2.5.egg-info





Ted Pederson wrote:
> First, is this possible? I see there are only binary installers up to 
> version 2.4.
> 
> I tried to download the platform independent pyPgSQL. I built and 
> installed it. The results of the build were:
> 
> running build
> running build_py
> running build_ext
> building 'pyPgSQL.libpq.libpq' extension
> error: None
> 
> I don't know if Error:None means success, or if it's an error without 
> any other info.
> 
> I can import pyPgSQL.
> 
> When I try to import libpq from pyPgSQL I get an error in the "from 
> libpq import *" line of the __init__ file of my libpq package.
> 
> I have added a path to the lib and bin dirs of my postPres installation, 
> this is where libpq.dll resides.
> 
> I am lost, any help greatly appreciated.
> 
> Ted
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Pypgsql-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pypgsql-users


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com