public inbox for [email protected]
help / color / mirror / Atom feedFrom: Daniele Varrazzo <[email protected]>
To: Gil Sousa <[email protected]>
Cc: [email protected]
Subject: Re: ImportError: symbol not found in flat namespace '_PQbackendPID'
Date: Wed, 7 Sep 2022 01:08:18 +0100
Message-ID: <CA+mi_8Yqqfde-dPSWv0QxJXEzK91MT0eXq7t93M4RjjRpaf=xQ@mail.gmail.com> (raw)
In-Reply-To: <CAOUL5-rK5Z8TfztbFo-uPOb37kjb9kcNiGUGZ7RKPSwny4X+Kg@mail.gmail.com>
References: <CAOUL5-rK5Z8TfztbFo-uPOb37kjb9kcNiGUGZ7RKPSwny4X+Kg@mail.gmail.com>
Hello,
On Tue, 6 Sept 2022 at 17:06, Gil Sousa <[email protected]> wrote:
>
> Hi all,
>
> I am trying to use psycopg2 for the very first time, though I am stumbling with an error when trying to import the module:
>
> ✗ python3.9 radars_import.py
> Traceback (most recent call last):
> File "/Users/gilsousa/Documents/git Projects/ReportGen/radars_import.py", line 2, in <module>
> import psycopg2
> File "/Users/gilsousa/Library/Python/3.9/lib/python/site-packages/psycopg2/__init__.py", line 51, in <module>
> from psycopg2._psycopg import ( # noqa
> ImportError: dlopen(/Users/gilsousa/Library/Python/3.9/lib/python/site-packages/psycopg2/_psycopg.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_PQbackendPID'
>
> I made sure that I have the packages installed, both psycopg2 and psycopg2-binary. I even tried to uninstall both and just try one at a time, also didn't work.
You should install only one of them. If you are using an apple M1,
psycopg2-binary doesn't actually install a binary package and falls
back to building from source.
> How can I fix this problem?
I don't have a macOS but the problem has surfaced often, according to
google. It seems related to the wrong installation of the libpq, and
it doesn't help that a few days ago Homebrew has broken the libpq
installation <https://github.com/psycopg/psycopg2/issues/1492;.
See https://gist.github.com/peter-gy/0ebe072acb9065944ecb04d95a4c3096
for an example of someone fixing your problem.
Cheers
-- Daniele
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: ImportError: symbol not found in flat namespace '_PQbackendPID'
In-Reply-To: <CA+mi_8Yqqfde-dPSWv0QxJXEzK91MT0eXq7t93M4RjjRpaf=xQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox