Search code examples
postgresqlmacosplpgsql

How to enable plpython3u on macOS?


When running the below

CREATE EXTENSION plpython3u

I get this

ERROR:  could not load library "/Library/PostgreSQL/14/lib/postgresql/plpython3.so": dlopen(/Library/PostgreSQL/14/lib/postgresql/plpython3.so, 0x000A): Library not loaded: /Library/edb/languagepack/v2/Python-3.9/lib/libpython3.9.dylib
  Referenced from: /Library/PostgreSQL/14/lib/postgresql/plpython3.so
  Reason: tried: '/Library/edb/languagepack/v2/Python-3.9/lib/libpython3.9.dylib' (no such file), '/usr/lib/libpython3.9.dylib' (no such file)
SQL state: 58P01
  • MacOS Monterey 12.0.1
  • pgAdmin 4 5.7
  • PostgresSQL 14
  • Python 3.9

Any ideas?


Solution

  • If you install Postgres with the EDB installer from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads, you can then choose to launch the Stack Builder after installation completes to then install "EDB Language Pack v2.0-1".

    I don't have a solution for Homebrew at the moment, but will update if I find one.