FileNotFoundError: [Errno 2] No such file or directory: 'pg_config'
What action do you want to perform
I want to run my tests with postgresql fixture as usual.
What are the results
When I run pytest, I get this error:
/usr/lib/python3.9/subprocess.py:1821: FileNotFoundError
=============================== short test summary info ================================
ERROR tests/test_main.py::test_hello - FileNotFoundError: [Errno 2] No such file or directory: 'pg_config'
================================= 1 error in 0.13s ====================================
When I was developing in Ubuntu 20.04, everything worked just fine. Before I install my new Pop OS 22.04 I've pushed the repo to Github and after installation, I've cloned it.
What are the expected results
That the tests run without a problem whatsoever.
@alac1984 do you have libpq-dev installed?
Yes, libpq-dev is installed (14.2-1ubuntu1). python3-dev is installed also. PostgreSQL 14 is of course installed and pg_config command can be run from terminal as usual. Some very specific thing in Pop OS 22.04 should be misplaced, and I really don't get what.
not sure, maybe the pg_config isn't being added to $PATH libpq-dev is the one that should deliver pg_config 🤔
Was this ever resolved? I'm running into this issue too on Mac OS Sonoma. I would have thought pytest-postgresql was installing everything it needed as a dependency, including libpq-dev.
I'm getting the error pytest_postgresql.exceptions.ExecutableMissingException: Could not found pg_config executable. Is it in systenm $PATH? while also using the psycopg2-binary
@GroomedGorilla pytest-postgresql 4.x and later work on psycopg 3.x
And libpq-dev is system dependency. You need to install it yourself.