Struggling to get pyscopg2 working on mac

A forum for general discussion of the Python programming language.

Struggling to get pyscopg2 working on mac

Postby 12thmonkey » Tue Sep 20, 2016 7:30 pm

Hi Guys,

I'm going nuts trying to get this work. I've seen a couple of posts on here stating that its best to use a VM, however i would like to get this working natively on the mac. I have tried this on Centos 7 with Oracle VB but it also returns the same issue.

I can install the package ok, output below.

Code: Select all
Collecting psycopg2
  Downloading psycopg2-2.6.2.tar.gz (376kB)
    100% |████████████████████████████████| 378kB 443kB/s
Installing collected packages: psycopg2
  Running setup.py install for psycopg2 ... done
Successfully installed psycopg2-2.6.2


Then when i try and import the package it get the following error.

Code: Select all
>>> import psycopg2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libssl.1.0.0.dylib
  Referenced from: /Library/Python/2.7/site-packages/psycopg2/_psycopg.so
  Reason: image not found
>>> ^D



I am using El Capitan 10.11.6

Can anyone help, I'm going crazy trying to get this to work.

I'm using python 2, connection details below.

Code: Select all
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


thank you.
Last edited by Yoriz on Tue Sep 20, 2016 7:46 pm, edited 1 time in total.
Reason: First post lock.
12thmonkey
 
Posts: 1
Joined: Tue Sep 20, 2016 7:24 pm

Re: Struggling to get pyscopg2 working on mac

Postby micseydel » Tue Sep 20, 2016 8:49 pm

How did you install it?
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Struggling to get pyscopg2 working on mac

Postby nilamo » Tue Sep 20, 2016 8:49 pm

12thmonkey wrote:>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: libssl.1.0.0.dylib
Referenced from: /Library/Python/2.7/site-packages/psycopg2/_psycopg.so
Reason: image not found
>>> ^D

(emphasis added)
...do you have ssl installed?
This forum is shutting down. Future discussion should take place at http://python-forum.io
User avatar
nilamo
 
Posts: 87
Joined: Thu Jul 21, 2016 8:00 pm
Location: Michigan


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 3 guests

cron