postgresql - Deployment issues of Psycopg2 Python App -
i have created application in python tested , runs on computer (mac osx 10.8.3 python2.7.3 postgresql9.2.4 psycopg2-2.5). app compiled using py2app, , can see build included packages/modules application contents folder.
psycopg2 imports correctly on machine, , app runs fine, when application runs on computer (i've tried 4 different computers...), fails open, , console message reads importerror: dlopen(/applications/app.app/contents/resources/lib/python2.7/psycopg2/_psycopg.so, 2): library not loaded: libpq.5.dylib
i have searched , modified code extensively through s.o. , google no avail. psycopg2 links not address issue. http://initd.org/psycopg/articles/2010/11/11/links-about-building-psycopg-mac-os-x/
i have removed , reinstalled psycopg2 & postgresql numerous times, building source, macports, homebrew, etc. current environment listed above, postgresql 9.2.4 installed homebrew, , psycopg2-2.5 installed source while explicitly linking pg_config location in setup.cfg
when run otool -l on _psycopg.so, following
/usr/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.4.0) /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 47.0.0) /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 47.0.0) /usr/lib/libsystem.b.dylib (compatibility version 1.0.0, current version 169.3.0)
how can built application include (or point target user files if available) these files? correct approach? py2app of course not include system files /usr/lib/ in "frameworks" option.
your copy of _psycopg.so linked system installation of libpq, not libpq home-brew build of postgresql 9.2.4.
because of application work on systems running osx 10.8.
the solution rebuild psycopg2 , make sure linked home-brew build of postgresql.
note py2app not copy files /usr/lib application bundles, when explicitly told include shared library, because assumes files in /usr system files , redistributing @ best dodgy w.r.t. licenses.
Comments
Post a Comment