簡體   English   中英

出現 RuntimeError: command not found: initdb for testing.postgresql.Postgresql

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

我有以下代碼。

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

我想為單元測試創建虛擬數據但收到此錯誤

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

僅供參考:我正在為數據庫 mocking 進行單元測試如果有更好的方法,請分享,謝謝!

我有同樣的問題,不知何故,我似乎錯過了 postgresql,甚至認為它以前使用過工作。 :) 如果在 Mac 上你可以使用 brew:

brew install postgresql

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM