Getting RuntimeError: command not found: initdb for testing.postgresql.Postgresql

Viewed 88

I have following code.

import testing.postgresql
sql = testing.postgresql.Postgresql(copy_data_from=r"path_to_my_sql_file.sql")

I want to create dummy data for unit testing but getting this error

raise RuntimeError("command not found: %s" % name)
RuntimeError: command not found: initdb

FYI: I am trying this for database mocking for unit testing If there are better ways to do it, please share, Thanks!!

1 Answers

I had the same issue, and somehow it seems I was missing postgresql, even thought it used work previously. :) If on mac you can use brew:

brew install postgresql
Related