rmusser01 / tldw

tl/dw (Too Long, Didn't Watch): Your Personal Research Multi-Tool - a naive attempt at 'A Young Lady's Illustrated Primer'
Apache License 2.0
383 stars 12 forks source link

psycopg2 error when using dockerfile #377

Closed DIGist closed 1 month ago

DIGist commented 1 month ago

Latest git clone

When trying to build the docker container psycopg2 fails to complete in pip install -r requirements.txt

13 32.98 Collecting psycopg2 (from -r requirements.txt (line 31))

13 33.00 Downloading psycopg2-2.9.10.tar.gz (385 kB)

13 33.11 Installing build dependencies: started

13 36.01 Installing build dependencies: finished with status 'done'

13 36.01 Getting requirements to build wheel: started

13 36.26 Getting requirements to build wheel: finished with status 'error'

13 36.27 error: subprocess-exited-with-error

13 36.27

13 36.27 × Getting requirements to build wheel did not run successfully.

13 36.27 │ exit code: 1

13 36.27 ╰─> [21 lines of output]

13 36.27 running egg_info

13 36.27 writing psycopg2.egg-info/PKG-INFO

13 36.27 writing dependency_links to psycopg2.egg-info/dependency_links.txt

13 36.27 writing top-level names to psycopg2.egg-info/top_level.txt

13 36.27

13 36.27 Error: pg_config executable not found.

13 36.27

13 36.27 pg_config is required to build psycopg2 from source. Please add the directory

13 36.27 containing pg_config to the $PATH or specify the full executable path with the

13 36.27 option:

13 36.27

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

13 36.27

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

13 36.27

13 36.27 If you prefer to avoid building psycopg2 from source, please install the PyPI

13 36.27 'psycopg2-binary' package instead.

13 36.27

13 36.27 For further information please check the 'doc/src/install.rst' file (also at

13 36.27 https://www.psycopg.org/docs/install.html).

13 36.27

13 36.27 [end of output]

13 36.27

13 36.27 note: This error originates from a subprocess, and is likely not a problem with pip.

13 36.35 error: subprocess-exited-with-error

13 36.35

13 36.35 × Getting requirements to build wheel did not run successfully.

13 36.35 │ exit code: 1

13 36.35 ╰─> See above for output.

13 36.35

13 36.35 note: This error originates from a subprocess, and is likely not a problem with pip.

13 ERROR: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1

Steps to to reproduce the issue Steps to reproduce the behavior:

  1. Git clone repo
  2. navigate to Helper_Scripts/Dockerfiles
  3. Run "sudo docker build -f tldw-nvidia_amd64_Dockerfile -t lstldw-nvidia_amd64_dockerfile ."
  4. See error

What was the expected behavior? TLDW container to be built.

Desktop (please complete the following information):

rmusser01 commented 1 month ago

Thank you for filing the issue, I will get this fixed tomorrow.

rmusser01 commented 1 month ago

Just made the change to the dockerfile + requirements.txt and pushed to main.

Please lmk if that doesn't resolve the issue

DIGist commented 1 month ago

Thanks! I still ran into the problem, but it seems resolved when I added "libpq-dev" to the apt-get install in the Latest "tldw-nvidia_amd64_Dockerfile"

rmusser01 commented 1 month ago

Thanks for the update, I’ll add that to the docker file and look into why that’s happening.

rmusser01 commented 1 month ago

Yea, so this is me getting ahead of myself, psycopg is a postgres req, but I'm not using postgres as a backend yet/have it as an option.

Seems the req was getting hit from my older RAG implementation. I've gone ahead and commented it out, but will add libpq-dev as a comment for when I put it back in.

Thanks again for filing the issue and then following up, much appreciated.