3

I've been trying to install psycopg2 on my OS X Yosemite machine for the past two days. I have python, postgreSQL installed. I've tried installing psycopg2 using:

sudo pip install psycopg2

It gets successfully installed, but when I import it in the python shell, I get this:

import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/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/3.4/lib/python3.4/site-packages/psycopg2/_psycopg.so, 2): 
Symbol not found: _lo_lseek64
Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/psycopg2/_psycopg.so
Expected in: /usr/lib/libpq.5.dylib
in /Library/Frameworks/Python.frame

I've looked at all the Stack Overflow questions related to this. Nothing works! I've also tried mac ports and I get a similar result.

update: I did what this said. Now I'm getting this:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libssl.1.0.0.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/psycopg2/_psycopg.so Reason: image not found

Community
  • 1
  • 1
dhaliman
  • 1,542
  • 1
  • 12
  • 23
  • Have you tried reverting to python 2.7 and install it again. I feel there might be some compatibility issue. – Aditya Patel Sep 08 '15 at 02:30
  • Maybe duplicate of http://stackoverflow.com/questions/28515972/problems-using-psycopg2-on-mac-os-yosemite – luoluo Sep 08 '15 at 02:30
  • Cannot replicate. I have tried installing `psycopg2` (Version 2.6.1) in a virtualenv with Python 3.4.3 on OS X Yosemite. Importing `psycopg2` works without problems. Can you tell which versions you're using? `pip freeze` should help to see what version of `psycopg2` you have installed on your system. – dotcs Sep 08 '15 at 06:26
  • This doesn't work as well .http://stackoverflow.com/questions/28515972/problems-using-psycopg2-on-mac-os-yosemite – dhaliman Sep 08 '15 at 08:40
  • I have psycopg2 version 2.6.1 installed. – dhaliman Sep 08 '15 at 08:42

0 Answers0