I have a M1 Max Mac(released in October 2021), and installed Django 4.1.1. I was trying to have my Django app connected to a PostgreSql database I created under DATABASES in settings.py. Successfully installed psycopg2-binary using pip3 install psycopg2-binary. In ENGINE I have django.db.backends.postgresql_psycopg2. When I run python3 manage.py runserver, I kept getting this error:
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/Users/hahaha/codingProjects/django/env/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 24, in <module>
import psycopg2 as Database
File "/Users/hahaha/codingProjects/django/env/lib/python3.9/site-packages/psycopg2/__init__.py", line 51, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: dlopen(/Users/hahaha/codingProjects/django/env/lib/python3.9/site-packages/psycopg2/_psycopg.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace (_PQbackendPID)
I was following the step from here to tackle the issue and then got
You are using macOS 12.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
and since then no success. Some guidance needed