Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [Errno 2] No such file or directory: 'pg_config' #598

Closed
alac1984 opened this issue Apr 28, 2022 · 5 comments · Fixed by #750
Closed

FileNotFoundError: [Errno 2] No such file or directory: 'pg_config' #598

alac1984 opened this issue Apr 28, 2022 · 5 comments · Fixed by #750

Comments

@alac1984
Copy link

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.

@fizyk
Copy link
Member

fizyk commented Apr 29, 2022

@alac1984 do you have libpq-dev installed?

@alac1984
Copy link
Author

alac1984 commented Apr 29, 2022

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.

@fizyk
Copy link
Member

fizyk commented Apr 30, 2022

not sure, maybe the pg_config isn't being added to $PATH libpq-dev is the one that should deliver pg_config 🤔

@GroomedGorilla
Copy link

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

@fizyk
Copy link
Member

fizyk commented Feb 26, 2024

@GroomedGorilla pytest-postgresql 4.x and later work on psycopg 3.x
And libpq-dev is system dependency. You need to install it yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants