[App-Server] pg_config executable not found

What I’m trying to do:

Upgrade an old App-Server Install to the latest version 1.5.2

What I’ve tried and what’s not working:

pip install --upgrade anvil-app-server

Error:

  Downloading psycopg2-2.8.6.tar.gz (383 kB)
     |████████████████████████████████| 383 kB 5.0 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import sys, setuptools, tokenize                    ; sys.argv[0] = '"'"'/tmp/pip-install-6k3lgz2d/psycopg2/setup.py'"'"'; __file__=                    '"'"'/tmp/pip-install-6k3lgz2d/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'o                    pen'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.                    close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/                    pip-install-6k3lgz2d/psycopg2/pip-egg-info
         cwd: /tmp/pip-install-6k3lgz2d/psycopg2/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-install-6k3lgz2d/psycopg2/pip-egg-info/psycopg2.egg-info
    writing /tmp/pip-install-6k3lgz2d/psycopg2/pip-egg-info/psycopg2.egg-info/PK                    G-INFO
    writing dependency_links to /tmp/pip-install-6k3lgz2d/psycopg2/pip-egg-info/                    psycopg2.egg-info/dependency_links.txt
    writing top-level names to /tmp/pip-install-6k3lgz2d/psycopg2/pip-egg-info/p                    sycopg2.egg-info/top_level.txt
    writing manifest file '/tmp/pip-install-6k3lgz2d/psycopg2/pip-egg-info/psyco                    pg2.egg-info/SOURCES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                    ry
    containing pg_config to the $PATH or specify the full executable path with t                    he
    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 PyP                    I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check th   

I assume the version of the App-Server I started with (not sure of the version number but it was around May/June 2020) cannot be upgraded and I might have to install fresh!

After further research on the generic error I thought it might be the version of PIP so I updated that.

The pip install --upgrade anvil-app-server now completed but with a lot of the same type of errors:

(venv) tony_67@ubserver:~$ pip install --upgrade anvil-app-server
Requirement already satisfied: anvil-app-server in ./venv/lib/python3.8/site-pac                               kages (1.1)
Collecting anvil-app-server
  Using cached anvil-app-server-1.5.2.tar.gz (84 kB)
Collecting anvil-uplink==0.3.36
  Using cached anvil_uplink-0.3.36-py2.py3-none-any.whl (61 kB)
Collecting pgcli
  Using cached pgcli-3.1.0-py3-none-any.whl (72 kB)
Requirement already satisfied: progressbar2 in ./venv/lib/python3.8/site-package                               s (from anvil-app-server) (3.51.3)
Collecting psutil
  Using cached psutil-5.8.0-cp38-cp38-manylinux2010_x86_64.whl (296 kB)
Requirement already satisfied: pychrome in ./venv/lib/python3.8/site-packages (f                               rom anvil-app-server) (0.2.3)
Requirement already satisfied: wheel in ./venv/lib/python3.8/site-packages (from                                anvil-app-server) (0.34.2)
Requirement already satisfied: ws4py in ./venv/lib/python3.8/site-packages (from                                anvil-uplink==0.3.36->anvil-app-server) (0.5.1)
Requirement already satisfied: six in ./venv/lib/python3.8/site-packages (from a                               nvil-uplink==0.3.36->anvil-app-server) (1.14.0)
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: future in ./venv/lib/python3.8/site-packages (fro                               m anvil-uplink==0.3.36->anvil-app-server) (0.18.2)
Collecting pgspecial>=1.11.8
  Downloading pgspecial-1.13.0-py3-none-any.whl (35 kB)
Collecting pendulum>=2.1.0
  Downloading pendulum-2.1.2-cp38-cp38-manylinux1_x86_64.whl (155 kB)
     |████████████████████████████████| 155 kB 2.9 MB/s
Collecting Pygments>=2.0
  Downloading Pygments-2.9.0-py3-none-any.whl (1.0 MB)
     |████████████████████████████████| 1.0 MB 3.3 MB/s
Collecting sqlparse<0.5,>=0.3.0
  Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 184 kB/s
Collecting cli-helpers[styles]>=2.0.0
  Downloading cli_helpers-2.1.0-py3-none-any.whl (20 kB)
Collecting configobj>=5.0.6
  Downloading configobj-5.0.6.tar.gz (33 kB)
Requirement already satisfied: click>=4.1 in ./venv/lib/python3.8/site-packages                                (from pgcli->anvil-app-server) (7.1.2)
Collecting setproctitle>=1.1.9
  Downloading setproctitle-1.2.2-cp38-cp38-manylinux1_x86_64.whl (36 kB)
Collecting prompt-toolkit<4.0.0,>=2.0.6
  Downloading prompt_toolkit-3.0.18-py3-none-any.whl (367 kB)
     |████████████████████████████████| 367 kB 5.0 MB/s
Collecting psycopg2>=2.8
  Using cached psycopg2-2.8.6.tar.gz (383 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import io, os, sys, setuptools,                                tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eqbz7e8z/psycopg2_1d62d4da3857459c                               b4db6d6eef8ace18/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eqbz7e8z/psycopg2                               _1d62d4da3857459cb4db6d6eef8ace18/setup.py'"'"';f = getattr(tokenize, '"'"'open'                               "'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from set                               uptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"                               '\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --eg                               g-base /tmp/pip-pip-egg-info-_rm8zo95
         cwd: /tmp/pip-install-eqbz7e8z/psycopg2_1d62d4da3857459cb4db6d6eef8ace1                               8/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-_rm8zo95/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-_rm8zo95/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-_rm8zo95/psycopg2.egg-info                               /dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-_rm8zo95/psycopg2.egg-info/                               top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-_rm8zo95/psycopg2.egg-info/SOUR                               CES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                               ry
    containing pg_config to the $PATH or specify the full executable path with t                               he
    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 PyP                               I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fd/ae/98cb7a0cbb1d74                               8ee547b058b14604bd0e9bf285a8e0cc5d148f8a8a952e/psycopg2-2.8.6.tar.gz#sha256=fb23                               f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543 (from https://pypi.                               org/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). C                               ommand errored out with exit status 1: python setup.py egg_info Check the logs f                               or full command output.
  Downloading psycopg2-2.8.5.tar.gz (380 kB)
     |████████████████████████████████| 380 kB 4.1 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import io, os, sys, setuptools,                                tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eqbz7e8z/psycopg2_a90636780a544160                               be4f23b707b5a093/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eqbz7e8z/psycopg2                               _a90636780a544160be4f23b707b5a093/setup.py'"'"';f = getattr(tokenize, '"'"'open'                               "'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from set                               uptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"                               '\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --eg                               g-base /tmp/pip-pip-egg-info-a2vgk199
         cwd: /tmp/pip-install-eqbz7e8z/psycopg2_a90636780a544160be4f23b707b5a09                               3/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-a2vgk199/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-a2vgk199/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-a2vgk199/psycopg2.egg-info                               /dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-a2vgk199/psycopg2.egg-info/                               top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-a2vgk199/psycopg2.egg-info/SOUR                               CES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                               ry
    containing pg_config to the $PATH or specify the full executable path with t                               he
    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 PyP                               I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a8/8f/1c5690eebf148d                               1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz#sha256=f7d4                               6240f7a1ae1dd95aab38bd74f7428d46531f69219954266d669da60c0818 (from https://pypi.                               org/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). C                               ommand errored out with exit status 1: python setup.py egg_info Check the logs f                               or full command output.
  Downloading psycopg2-2.8.4.tar.gz (377 kB)
     |████████████████████████████████| 377 kB 6.1 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import io, os, sys, setuptools,                                tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eqbz7e8z/psycopg2_7127416a83df4068                               832e5527785f798d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eqbz7e8z/psycopg2                               _7127416a83df4068832e5527785f798d/setup.py'"'"';f = getattr(tokenize, '"'"'open'                               "'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from set                               uptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"                               '\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --eg                               g-base /tmp/pip-pip-egg-info-djdb_tyl
         cwd: /tmp/pip-install-eqbz7e8z/psycopg2_7127416a83df4068832e5527785f798                               d/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-djdb_tyl/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-djdb_tyl/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-djdb_tyl/psycopg2.egg-info                               /dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-djdb_tyl/psycopg2.egg-info/                               top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-djdb_tyl/psycopg2.egg-info/SOUR                               CES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                               ry
    containing pg_config to the $PATH or specify the full executable path with t                               he
    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 PyP                               I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4                               d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz#sha256=f898                               e5cc0a662a9e12bde6f931263a1bbd350cfb18e1d5336a12927851825bb6 (from https://pypi.                               org/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). C                               ommand errored out with exit status 1: python setup.py egg_info Check the logs f                               or full command output.
  Downloading psycopg2-2.8.3.tar.gz (377 kB)
     |████████████████████████████████| 377 kB 5.0 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import io, os, sys, setuptools,                                tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eqbz7e8z/psycopg2_b3d8288a428f45bc                               93d356f66e2538af/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eqbz7e8z/psycopg2                               _b3d8288a428f45bc93d356f66e2538af/setup.py'"'"';f = getattr(tokenize, '"'"'open'                               "'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from set                               uptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"                               '\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --eg                               g-base /tmp/pip-pip-egg-info-_gzkmamp
         cwd: /tmp/pip-install-eqbz7e8z/psycopg2_b3d8288a428f45bc93d356f66e2538a                               f/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-_gzkmamp/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-_gzkmamp/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-_gzkmamp/psycopg2.egg-info                               /dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-_gzkmamp/psycopg2.egg-info/                               top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-_gzkmamp/psycopg2.egg-info/SOUR                               CES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                               ry
    containing pg_config to the $PATH or specify the full executable path with t                               he
    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 PyP                               I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/5c/1c/6997288da18127                               7a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz#sha256=897a                               6e838319b4bf648a574afb6cabcb17d0488f8c7195100d48d872419f4457 (from https://pypi.                               org/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). C                               ommand errored out with exit status 1: python setup.py egg_info Check the logs f                               or full command output.
  Downloading psycopg2-2.8.2.tar.gz (368 kB)
     |████████████████████████████████| 368 kB 5.0 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import io, os, sys, setuptools,                                tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eqbz7e8z/psycopg2_718af604860d4ddc                               a7f25101b5266c69/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eqbz7e8z/psycopg2                               _718af604860d4ddca7f25101b5266c69/setup.py'"'"';f = getattr(tokenize, '"'"'open'                               "'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from set                               uptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"                               '\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --eg                               g-base /tmp/pip-pip-egg-info-m35uv7v1
         cwd: /tmp/pip-install-eqbz7e8z/psycopg2_718af604860d4ddca7f25101b5266c6                               9/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-m35uv7v1/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-m35uv7v1/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-m35uv7v1/psycopg2.egg-info                               /dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-m35uv7v1/psycopg2.egg-info/                               top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-m35uv7v1/psycopg2.egg-info/SOUR                               CES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                               ry
    containing pg_config to the $PATH or specify the full executable path with t                               he
    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 PyP                               I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/23/7e/93c325482c3286                               19870b6cd09370f6dbe1148283daca65115cd63642e60f/psycopg2-2.8.2.tar.gz#sha256=5cac                               f21b6f813c239f100ef78a4132056f93a5940219ec25d2ef833cbeb05588 (from https://pypi.                               org/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). C                               ommand errored out with exit status 1: python setup.py egg_info Check the logs f                               or full command output.
  Downloading psycopg2-2.8.1.tar.gz (367 kB)
     |████████████████████████████████| 367 kB 6.8 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import io, os, sys, setuptools,                                tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eqbz7e8z/psycopg2_68c2d24ce78b4dc4                               ac2fdec588ccccb5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eqbz7e8z/psycopg2                               _68c2d24ce78b4dc4ac2fdec588ccccb5/setup.py'"'"';f = getattr(tokenize, '"'"'open'                               "'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from set                               uptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"                               '\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --eg                               g-base /tmp/pip-pip-egg-info-v37op5nw
         cwd: /tmp/pip-install-eqbz7e8z/psycopg2_68c2d24ce78b4dc4ac2fdec588ccccb                               5/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-v37op5nw/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-v37op5nw/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-v37op5nw/psycopg2.egg-info                               /dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-v37op5nw/psycopg2.egg-info/                               top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-v37op5nw/psycopg2.egg-info/SOUR                               CES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                               ry
    containing pg_config to the $PATH or specify the full executable path with t                               he
    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 PyP                               I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/52/be/f898e712f5f081                               31d651a62754fca82a1deb42e4e9889ad01932f770a2be/psycopg2-2.8.1.tar.gz#sha256=b4a4                               75ce87eabc0607e068a3c704d0aa0820237ed78d493b8e2d880eb73cd7fe (from https://pypi.                               org/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). C                               ommand errored out with exit status 1: python setup.py egg_info Check the logs f                               or full command output.
  Downloading psycopg2-2.8.tar.gz (367 kB)
     |████████████████████████████████| 367 kB 10.1 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/tony_67/venv/bin/python -c 'import io, os, sys, setuptools,                                tokenize; sys.argv[0] = '"'"'/tmp/pip-install-eqbz7e8z/psycopg2_c18551173b4f462d                               b3501ba88fd0fb52/setup.py'"'"'; __file__='"'"'/tmp/pip-install-eqbz7e8z/psycopg2                               _c18551173b4f462db3501ba88fd0fb52/setup.py'"'"';f = getattr(tokenize, '"'"'open'                               "'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from set                               uptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"                               '\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --eg                               g-base /tmp/pip-pip-egg-info-uwos_ycr
         cwd: /tmp/pip-install-eqbz7e8z/psycopg2_c18551173b4f462db3501ba88fd0fb5                               2/
    Complete output (23 lines):
    running egg_info
    creating /tmp/pip-pip-egg-info-uwos_ycr/psycopg2.egg-info
    writing /tmp/pip-pip-egg-info-uwos_ycr/psycopg2.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-uwos_ycr/psycopg2.egg-info                               /dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-uwos_ycr/psycopg2.egg-info/                               top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-uwos_ycr/psycopg2.egg-info/SOUR                               CES.txt'

    Error: pg_config executable not found.

    pg_config is required to build psycopg2 from source.  Please add the directo                               ry
    containing pg_config to the $PATH or specify the full executable path with t                               he
    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 PyP                               I
    'psycopg2-binary' package instead.

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

    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c7/ca/75236b17f1b951                               950ffc55d657c5aa408d3d0327a1b6c4c0f7cb16ef7e7b/psycopg2-2.8.tar.gz#sha256=49c583                               8d90e83217909db3789d30a105385b5e696ec5168cda645546c542f35a (from https://pypi.or                               g/simple/psycopg2/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). Com                               mand errored out with exit status 1: python setup.py egg_info Check the logs for                                full command output.
Collecting pgcli
  Downloading pgcli-3.0.0-py3-none-any.whl (70 kB)
     |████████████████████████████████| 70 kB 951 kB/s
etc

I checked the version of python3 and I have 3.8.5 but the App-Server install docs say to use 3.7.

I did do an update of Ubuntu which I did not realise would update all packages including Python.

So I guess that is the problem.

Now how do I recover this? Can I downgrade the python version or should I just re-install ubuntu from scratch?

Learn something new everyday by making mistakes everyday… :exploding_head:

Whenever you use Python it is highly recommended you use a virtual environment. I prefer conda but virtualenv is popular also.

Just make a new environment and install the appropriate Python in that environment then install the Anvil app server using that environment. Always remember to switch to that environment (I name mine anvil, creative I know) to do anything with the app server.

Hi @apearce,

This is a problem with installing the psycopg2 module (for accessing Postgres from Python), nothing Anvil-specific. It looks like you’re missing the Postgres client libraries - apt-get install libpq-dev should sort you out :slight_smile:

(But what @robert says is absolutely right - you will make life a lot easier for yourself if you work in a virtualenv!)

1 Like