gdcc / dataverse-ansible

Ansible role for installing Dataverse
GNU General Public License v3.0
18 stars 21 forks source link

pg_config executable not found #351

Open pdurbin opened 6 months ago

pdurbin commented 6 months ago

I started following https://guides.dataverse.org/en/6.2/_downloads/71f100f4398dbdc9b2d388ffdc251da2/README_python.txt but decide to use the version with venv instead at https://guides.dataverse.org/en/6.2/developers/classic-dev-env.html#run-the-dataverse-software-installer-script

However, there's an error:

[dataverse@ip-172-31-8-57 6.2]$ python3 --version
Python 3.6.8
[dataverse@ip-172-31-8-57 6.2]$ python3 -m venv venv
[dataverse@ip-172-31-8-57 6.2]$ source venv/bin/activate
(venv) [dataverse@ip-172-31-8-57 6.2]$ pip install psycopg2-binary
Collecting psycopg2-binary
  Downloading https://files.pythonhosted.org/packages/9d/3d/5ddb908d2e5fdeb8678470d3f654e987356c9f981867313489b063fbe814/psycopg2-binary-2.9.8.tar.gz (383kB)
    100% |████████████████████████████████| 389kB 1.9MB/s 
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/psycopg2_binary.egg-info
    writing pip-egg-info/psycopg2_binary.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/psycopg2_binary.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/psycopg2_binary.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/psycopg2_binary.egg-info/SOURCES.txt'

    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>).

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qxn5jggt/psycopg2-binary/
You are using pip version 9.0.3, however version 24.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) [dataverse@ip-172-31-8-57 6.2]$ 
pdurbin commented 6 months ago

https://stackoverflow.com/questions/11618898/pg-config-executable-not-found says I should be able to get it from the postgresql-devel package, but:

[root@ip-172-31-8-57 ~]# yum install postgresql-devel
Last metadata expiration check: 0:41:39 ago on Thu 16 May 2024 03:02:23 PM UTC.
Error: 
 Problem: cannot install the best candidate for the job
  - nothing provides perl(IPC::Run) needed by postgresql16-devel-16.3-1PGDG.rhel8.x86_64 from pgdg16
  - nothing provides perl(IPC::Run) needed by postgresql15-devel-15.7-1PGDG.rhel8.x86_64 from pgdg15
  - nothing provides perl(IPC::Run) needed by postgresql14-devel-14.12-1PGDG.rhel8.x86_64 from pgdg14
  - nothing provides perl(IPC::Run) needed by postgresql13-devel-13.15-1PGDG.rhel8.x86_64 from pgdg13
  - nothing provides perl(IPC::Run) needed by postgresql12-devel-12.19-1PGDG.rhel8.x86_64 from pgdg12
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@ip-172-31-8-57 ~]# 
pdurbin commented 6 months ago

Oh. The python3-psycopg2 RPM is already installed. Maybe I'm all set?

pdurbin commented 6 months ago

I'm getting "Couldn't create database or database already exists" but I'm not sure why.

performing database setup
Admin database connectivity succeeds.
PostgreSQL version: 13
Couldn't create database or database already exists.