Issue with postgresql in the environment

Hi,

Following renku recommendations, we created a separate repository containing the environment in an environment.yml file. Unfortunately, we the PostgreSQL command seems to be ignored - at least it is not recognized by terminal into the renku session. How can we import PostgreSQL correctly?
Thanks in advance

Bruno

Hi @bruno,

Would it be possible for you to share your environment.yml file or your source repository?

I am not sure about what is the issue you are facing.

I can create a session environment with the following content:

name: "base"
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.13
  - pip
  - postgresql
prefix: "/opt/conda"

Once the session is started, I can then initialize and run a local postgresql database:

export PGDATA="/home/renku/work/pgdata"
pg_ctl init
pg_ctl -D /home/renku/work/pgdata -l logfile start
pg_ctl status
pg_ctl: server is running (PID: 1239)
psql postgres
psql (18.1)
Type "help" for help.

postgres=#

Here’s the environment I use:

name: “base”
channels:

  • conda-forge

  • gimli

  • nodefaults
    dependencies:

  • postgresql

  • nodejs>=12.0.0

  • pip:

    • dash

    • plotly

    • pandas

    • openpyxl

    • seaborn

    • psycopg2

    • pyproj

    • matplotlib==3.7.0

    • jupyterlab>=4,<5

    • ipywidgets

    • pygimli>=1.5.0

    • numpy<2 # A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6 as it may crash

    • jupyter-server-proxy

    • werkzeug==2.2.1

    • itsdangerous

    • werkzeug

    • gunicorn

    • flask_sqlalchemy

      Thanks for your quick answer, I will try what you suggest as well!

So I tried your environment, but it seems there is still some issues, as the terminal doesn’t recognize the psql command

Hi @bruno, is it possible for you to post here you project and the contents of the console when you try to use the psql command?

Hi @bruno , you can check the environment as suggested by @leafty working here.