question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

postgresql is required on macOS Monterey

See original GitHub issue

Description

On macOS Monterey postgresql is required in order to install Synapse.

Steps to reproduce

Run poetry install --extras all and notice how it fails.

$ poetry install --extras all
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing psycopg2 (2.9.3): Failed

  EnvCommandError

  Command ['/Users/jm/Library/Caches/pypoetry/virtualenvs/matrix-synapse-9UQhfgjM-py3.8/bin/pip', 'install', '--no-deps', 'file:///Users/jm/Library/Caches/pypoetry/artifacts/3c/7a/60/e4a0d26c4cee1923be3b7ae2cb545f115a822e112a6c5b5434bd25eacd/psycopg2-2.9.3.tar.gz'] errored with the following return code 1, and output:
  Processing /Users/jm/Library/Caches/pypoetry/artifacts/3c/7a/60/e4a0d26c4cee1923be3b7ae2cb545f115a822e112a6c5b5434bd25eacd/psycopg2-2.9.3.tar.gz
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    error: subprocess-exited-with-error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [25 lines of output]
        running egg_info
        creating /private/var/folders/zv/cnks6dx14rl25kvgqslhpv740000gn/T/pip-pip-egg-info-qrjfl19z/psycopg2.egg-info
        writing /private/var/folders/zv/cnks6dx14rl25kvgqslhpv740000gn/T/pip-pip-egg-info-qrjfl19z/psycopg2.egg-info/PKG-INFO
        writing dependency_links to /private/var/folders/zv/cnks6dx14rl25kvgqslhpv740000gn/T/pip-pip-egg-info-qrjfl19z/psycopg2.egg-info/dependency_links.txt
        writing top-level names to /private/var/folders/zv/cnks6dx14rl25kvgqslhpv740000gn/T/pip-pip-egg-info-qrjfl19z/psycopg2.egg-info/top_level.txt
        writing manifest file '/private/var/folders/zv/cnks6dx14rl25kvgqslhpv740000gn/T/pip-pip-egg-info-qrjfl19z/psycopg2.egg-info/SOURCES.txt'
        /Users/jm/Library/Caches/pypoetry/virtualenvs/matrix-synapse-9UQhfgjM-py3.8/lib/python3.8/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
          warnings.warn(msg, warning_class)

        Error: pg_config executable not found.

        pg_config is required to build psycopg2 from source.  Please add the directory
        containing pg_config to the $PATH or specify the full executable path with the
        option:

            python setup.py build_ext --pg-config /path/to/pg_config build ...

        or with the pg_config option in 'setup.cfg'.

        If you prefer to avoid building psycopg2 from source, please install the PyPI
        'psycopg2-binary' package instead.

        For further information please check the 'doc/src/install.rst' file (also at
        <https://www.psycopg.org/docs/install.html>).

        [end of output]

        ...

After running brew install postgresql it succeeds.

I think we should add this in the platform-specific installation instructions for macOS: https://matrix-org.github.io/synapse/latest/setup/installation.html#macos

Homeserver

n/a

Synapse Version

Current develop

Installation Method

n/a

Platform

macOS Monterey

Relevant log output

n/a

Anything else that would be useful to know?

n/a

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
richvdhcommented, Aug 8, 2022

We should probably be requiring or allowing psycopg2-binary instead.

This seems to be a mess - cf https://www.psycopg.org/articles/2018/02/08/psycopg-274-released/ and https://github.com/psycopg/psycopg2/issues/674. To cut a long story short: use of psycopg2-binary seems to be risky. Previously, allowing an either/or situation was tricky, but maybe that has now changed?

Unfortunately I don’t think using psycopg2-binary would help here – it seems to only have wheels for Intel Macs. 😢

This seems to be https://github.com/psycopg/psycopg2/issues/1482

1reaction
Johennescommented, Aug 5, 2022

Sorry, this is Python 3.8.9 on an M1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

macOS packages - PostgreSQL
You can get macOS PostgreSQL packages from several different sources. Interactive installer by EDB. Download the installer certified by EDB for all supported ......
Read more >
Error Installing Postgres on macOS Monterey 12.0.1 - Reddit
I got postgresql server, PG Admin 4. Do I need the command line tools to install this?
Read more >
Install and Use PostgreSQL 14 on macOS Monterey
Method 1: Install PostgreSQL 14 Manually on macOS Monterey · Step 1. Download the Postgres.app · Step 2. Move the Downloaded File to...
Read more >
Can't install Postgres on MacBook M1, Mac OS Monterey 12.4
I have problems installing Postgres on my MacBook M1.
Read more >
Starting PostgreSQL Server on Mac OS X via Homebrew
In most cases, you'll likely wish to have PostgreSQL launch when you start up your system, so you'll need to tell your computer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found