You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Catalina broke postgreSQL - Python -psycopg2

My install broke postgreSQL. After more than a week of much frustration, I finally got my DB back.


Now, I cannot access it using Python.


I did a fresh install of Python 3.7 followed by

pip install psycopg2


This install does not seem to work because the 'import psycopg2' statements gets an error : cannot find  libssl.1.1.dylib


The file is present in the following locations:

/Library/Frameworks/Python.framework/Versions/3.7/lib/libssl.1.1.dylib
/Library/PostgreSQL/12/lib/libssl.1.1.dylib
/Library/edb/languagepack/v1/Python-3.7/lib/libssl.1.1.dylib


This all worked before Catalina, but installing it after Catalina has broken it.


Ideas ?



iMac Line (2012 and Later)

Posted on Nov 8, 2019 8:33 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 8, 2019 10:01 AM

Python 3.7.4 and 3.8.0 include pip3, but no pip in the framework contents of either. I install stuff from PyPy using pip3. I believe the psycopg2 installation instructions were not updated for Python3 and they are still using the Python2.7 compatible pip in their installation instructions.


The psycopg2 v2.7.n package automatically installed the binary-packages which included its own private SSL library. The current v2.8.4 pyscopg2 has separated the binary-packages out into their own entity:


pip3 install psycopg2-binary


I think, based what I have read in the pyscopg2 v2.8.4 installation guide, this mayt resolve your current installation issues.

Similar questions

5 replies
Question marked as Top-ranking reply

Nov 8, 2019 10:01 AM in response to crashmeister

Python 3.7.4 and 3.8.0 include pip3, but no pip in the framework contents of either. I install stuff from PyPy using pip3. I believe the psycopg2 installation instructions were not updated for Python3 and they are still using the Python2.7 compatible pip in their installation instructions.


The psycopg2 v2.7.n package automatically installed the binary-packages which included its own private SSL library. The current v2.8.4 pyscopg2 has separated the binary-packages out into their own entity:


pip3 install psycopg2-binary


I think, based what I have read in the pyscopg2 v2.8.4 installation guide, this mayt resolve your current installation issues.

Nov 8, 2019 8:56 AM in response to crashmeister

The Python 3.7 distribution should contain pip3, and if the distribution is installed properly the proper "pip" command would be to use pip3, as pip may try to reference Apple's python installation. Have you visited the psycopg2 site and determined what its dependencies are. It may require a newer libssl than what is installed by Python 3.7 (now quite old). Python 3.8.0 is released.


I never install Python from a package manager. I download and install the latest installer from Python.org for its simplicity. The framework is installed in /Library/Frameworks/Python.framework and there are links from several binaries in that framework back into /usr/local/bin. And pip3 is among them. When you run pip3, it knows where the framework contents resides.


For the first time, Apple installs Python 3.7.3 with Xcode, or the Command Line Tools for Xcode on Catalina. This is an incomplete Python distribution, and should not be used (in my opinion). It is not compiled against any Tk/Tcl library either, which explains why idle3 is missing. Prefixing a Python script with #!/usr/bin/env python3 will also launch Apple's Python3 without some deft PATH, or PYTHONPATH changes.

Nov 8, 2019 9:15 AM in response to VikingOSX

I installed Python from python.org. I always do that. Ditto ' #!/usr/bin/env python3'.


FYI: When you update pip3 it includes pip, so the two are synonymous after the update. I was using pip3 until I did the pip update.

Command pip --version now shows:

pip 19.3.1 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7) 


Now that that's out of the way, any ideas on why psycopg2 is misbehaving ?


Catalina broke postgreSQL - Python -psycopg2

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.