I ran pip install psycopg2-binary and it worked like charm

More info about the binary package

Python 3

pip3 install psycopg2-binary
Answer from Laban on Stack Overflow
🌐
GitHub
gist.github.com › prakashanantha › f957e6a9a193ac1bd8bf
Installing psycopg2 on a mac · GitHub
Using a Python virtual environment on MacOS with a homebrew installation of Python 3.14 works: python3 -m venv project_name source project_name/bin/activate python3 -m pip install psycopg2
🌐
DEV Community
dev.to › tieje › how-to-install-psycopg2-on-an-m1-mac-mie
How to Install psycopg2 on an M1 Mac - DEV Community
March 25, 2022 - As I mentioned in the introduction, you can use Docker to containerize your application and ultimately install psycopg2. But it's not the simplest or the fastest solution. If you must do it this way, here a few helpful links to the Github project that I was working on at the time to help you get started: ... I hope this helps. It appears that Apple's M1 chip has received a ton of support from the developer community over the past year, which makes me less inclined to sell my Mac Air for a Framework laptop.
Discussions

psycopg2 install on macOS
UPDATE: Ok, I got it installed using just the source package instead of binary, just had to jump through the hoops to get my compiling situation setup. More on reddit.com
🌐 r/PostgreSQL
4
3
August 13, 2021
psycopg2-binary fails to install on macOS Big Sur 11.0.1 and Python 3.9.0 (with possible workaround)
$ SYSTEM_VERSION_COMPAT=1 pip install psycopg2-binary Collecting psycopg2-binary Downloading psycopg2_binary-2.8.6-cp39-cp39-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.5 MB) |██████████████████████████... More on github.com
🌐 github.com
69
November 21, 2020
psycopg2 not being installed!! (same with psycopg2-binary)
The error tells you what is missing. pg_setup executable not found. You have to install the postgresql library. More on reddit.com
🌐 r/django
7
2
January 6, 2025
pip2 install psycopg2 raise error on MacBook Air (M1, 2020)
Might wanna get python3. More on reddit.com
🌐 r/django
10
0
May 17, 2022
🌐
Medium
sebacode.medium.com › install-psycopg2-en-apple-m1-c254aaf3f3d9
Install psycopg2 en Apple M1 - Sebastián Vidal Aedo - Medium
December 13, 2022 - Install psycopg2 en Apple M1 M1, you’re so cool, but sometimes you get complicated with dependencies… like psycopg2 :( I am currently working with a Django project. I think everything will work …
🌐
YouTube
youtube.com › brian huynh
Install Psycopg2 package on Mac - YouTube
Step 1: - export PG_HOME=/Library/PostgreSQL/14 - export PATH=$PATH:$PG_HOME/binStep 2: - pip install psycopg2Please like for me, thank you very much
Published   March 28, 2022
Views   5K
🌐
Vince
vince.id › posts › installing-psycopg2-on-macos
Installing psycopg2 on MacOS - /var/log/vince
The solution is to install openssl with brew, and then manually provide the directory to the linker with the LDFLAGS option when installing. The directory is the default installation directory for brew, like so: $ env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" poetry ...
Find elsewhere
🌐
Reddit
reddit.com › r/postgresql › psycopg2 install on macos
r/PostgreSQL on Reddit: psycopg2 install on macOS
August 13, 2021 -

So I'm not a "mac guy", but I have a system running High Sierra that I need to install psycopg2 on. I did the following:

  • Installed Python 3.9.6 from python.org installer

  • Installed PostgreSQL 13 from official installers

  • Added PostgreSQL binaries directory to my PATH

  • Ran pip3 install --user psycopg2-binary

It all seems to go through, but I get an error trying to import psycopg2 in my Python3 environment:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/myuser/env/lib/python3.9/site-packages/psycopg2/__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
ImportError: dlopen(/Users/myuser/env/lib/python3.9/site-packages/psycopg2/_psycopg.cpython-39-darwin.so, 2): Symbol not found: ____chkstk_darwin
  Referenced from: /Users/myuser/env/lib/python3.9/site-packages/psycopg2/.dylibs/libcrypto.1.1.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/myuser/env/lib/python3.9/site-packages/psycopg2/.dylibs/libcrypto.1.1.dylib

I have seen people talk about installing Python or PostgreSQL via homebrew, but for various reasons that's not an option in this situation. How can I get this working using official installers?

🌐
PyPI
pypi.org › project › psycopg2
psycopg2 · PyPI
Download the file for your platform. If you're not sure which to choose, learn more about installing packages. ... Filter files by name, interpreter, ABI, and platform. If you're not sure about the file name format, learn more about wheel file names.
      » pip install psycopg2
    
Published   Apr 20, 2026
Version   2.9.12
🌐
DevPress
devpress.csdn.net › postgresql › 62f4d8ffc6770329307fa560.html
How to Install psycopg2 on an M1 Mac_python_Postgredaxiang-PostgreSQL
August 11, 2022 - As I mentioned in the introduction, you can use Docker to containerize your application and ultimately install psycopg2. But it's not the simplest or the fastest solution. If you must do it this way, here a few helpful links to the Github project that I was working on at the time to help you get started: ... I hope this helps. It appears that Apple's M1 chip has received a ton of support from the developer community over the past year, which makes me less inclined to sell my Mac Air for a Framework laptop.
🌐
MacPorts
ports.macports.org › port › py-psycopg2
Install py-psycopg2 on macOS with MacPorts
Psycopg2 is a postgresql database adapter for python. It's fully compliant to python's DBAPI-2.0.
🌐
Jinyuz
jinyuz.dev › posts › installing-psycopg2-in-macos
Installing Psycopg2 in Macos · / root
July 29, 2022 - TL;DR #env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2 # OR env LDFLAGS="-I/usr/local/opt/openssl@3/include -L/usr/local/opt/openssl@3/lib" pip install psycopg2 # OR # https://github.com/brianmario/mysql2/issues/795#issuecomment-337006164 env ...
🌐
Anaconda.org
anaconda.org › anaconda › psycopg2
psycopg2 - anaconda | Anaconda.org
Install psycopg2 with Anaconda.org. PostgreSQL database adapter for Python
🌐
Developer Diary
varunver.wordpress.com › 2015 › 04 › 24 › installing-psycopg2-on-a-mac
Installing psycopg2 on a Mac – Developer Diary
June 26, 2021 - Pretty crazy installation for a Mac. Here's what I had to do: 1. Get the latest source package from psycopg site. In my case, I got v2.6. Save this to your tmp dir 2. Follow installation using source package…
🌐
GitHub
github.com › psycopg › psycopg2 › issues › 1200
psycopg2-binary fails to install on macOS Big Sur 11.0.1 and Python 3.9.0 (with possible workaround) · Issue #1200 · psycopg/psycopg2
November 21, 2020 - $ SYSTEM_VERSION_COMPAT=1 pip install psycopg2-binary Collecting psycopg2-binary Downloading psycopg2_binary-2.8.6-cp39-cp39-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.5 MB) |█████████...
Author   psycopg
🌐
PyPI
pypi.org › project › psycopg2-binary
psycopg2-binary · PyPI
psycopg2_binary-2.9.12-cp313-cp313-macosx_11_0_arm64.whl (3.8 MB view details)
      » pip install psycopg2-binary
    
Published   Apr 20, 2026
Version   2.9.12
🌐
Psycopg
psycopg.org › docs › install.html
Installation — Psycopg 2.9.12 documentation
This will install a pre-compiled binary version of the module which does not require the build or runtime prerequisites described below. Make sure to use an up-to-date version of pip (you can upgrade it using something like pip install -U pip). You may then import the psycopg2 package, as usual:
🌐
GitHub
gist.github.com › iraquitan › 3120e0a4349c80000ff9dede8cafe5eb
PostgreSQL and psycopg2 initial setup on Mac with Homebrew and Python 3 · GitHub
PostgreSQL and psycopg2 initial setup on Mac with Homebrew and Python 3 - mac-brew-python3-postgresql-psycopg2
🌐
Convergencehappens
blog.convergencehappens.com › 2021 › 02 › installing-python-391-and-psycopg2-on.html
Convergence Happens: Installing Python 3.9.1 and psycopg2 on Big Sur 11.1 - Apple M1
February 6, 2021 - $ OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install scipy --no-use-pep517 ... Hello, I really need your help. I'm using macOS Big SUR version 11.2.1, Python 3.8.2, Postgresql 13, with Django. I’m trying to connect Postgresql with Django in a virtual environment. I’m unable to resolve the below error. Any help would be much appreciated. ImproperlyConfigured: Error loading psycopg2 module: dl open(/Users/inqline/Library/Python/3.8/lib/python/site-packages/psycopg2/_psyc opg.cpython-38-darwin.so, 2): Library not loaded: @rpath/libssl.1.1.dylib Referenced from: /Users/inqline/Library/Python/3.8/lib/python/site-packages/ psycopg2/_psycopg.cpython-38-darwin.so Reason: image not found ReplyDelete