gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] Problem importing psycopg2 on Mac OS 10.6


From: Busser, Jim
Subject: [Gnumed-devel] Problem importing psycopg2 on Mac OS 10.6
Date: Mon, 4 Nov 2013 02:57:21 +0000

I am trying Sebastian's most recent offlist instructions trying to get GNUmed to run natively on Mac.

I am trying on a backup machine (Mac OS 10.6), before trying it on my production machine.

I got to the part where Sebastian had advised (but with corresponding Canadian locales)

python
 
import psycopg2
 
export LANG=“en_CA.UTF-8"
export LC_COLLATE=“en_CA.UTF-8"
export LC_CTYPE=“en_CA.UTF-8"
export LC_MESSAGES=“en_CA.UTF-8"
export LC_MONETARY=“en_CA.UTF-8"
export LC_NUMERIC=“en_CA.UTF-8"
export LC_TIME=“en_CA.UTF-8"
export LC_ALL=

And in spite of adding a third symlink as seemed required (and seeming to have to do so directly as root instead of sudo)

sudo ln -s /Library/PostgreSQL/9.1/lib/libssl.1.0.0.dylib /usr/lib
sudo ln -s /Library/PostgreSQL/9.1/lib/libcrypto.1.0.0.dylib /usr/lib
sudo ln -s /Library/PostgreSQL/9.1/lib/libpq.5.dylib /usr/lib

I get a version problem with libssl, see below, 

It is worth remarking that as a result of the above symlink, the command

ls /usr/lib/libssl* yields

libssl.0.9.dylib
libssl.0.9.7.dylib
libssl.0.9.8.dylib
libssl.1.0.0.dylib
libssl.dylib

… I am not sure what I should do, especially if something on that machine should still need 0.9.x.

-- Jim

===========
python
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libssl.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so
  Reason: Incompatible library version: _psycopg.so requires version 1.0.0 or later, but libssl.0.9.8.dylib provides version 0.9.8
>>> 

=======================================
The rest is just a list of what I had tried with psycopg2
=======================================

My first problem was my failure after I did

cd /Users/dad/Downloads/psycopg2-2.5.1/

 to include the python command ahead of

/Users/dad/Downloads/psycopg2-2.5.1/setup.py install

and resulting in

-bash: /Users/dad/Downloads/psycopg2-2.5.1/setup.py: Permission denied

which led me to instead install psycopg2 via setup tools and PIP, which reported success, after which an attempted re-install using the method of Sebastian

python /Users/dad/Downloads/psycopg2-2.5.1/setup.py install

gave me this error

error: could not delete '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so': Permission denied

and when running python and attempting to import psycopg2 I got

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libpq.5.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so Reason: image not found

which in retrospect maybe because -- at least under Mac OS 10.6 -- a symlink for libpq.5.dylib was also needed.  Anyhow I eventually achieved to do a psycopg2 uninstall 'pip uninstall psycopg2' (after removing psycopg2-related items in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ )

after which

python /Users/dad/Downloads/psycopg2-2.5.1/setup.py install

worked.

-- Jim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]