0%

macOS安装Postgresql

pip安装依赖的时候报错,pg_config executable not found, 所以需要在mac上安装postgresql。

1
brew install postgresql

如果出现Updating Homebrew并且卡住了,请参考

安装过程中,有可能会遇到操作文件权限不够的情况,添加一下权限就可以了。

安装成功,将有如下提示:

1
2
3
4
5
6
7
8
9
10
11
To migrate existing data from a previous major version of PostgreSQL run:
brew postgresql-upgrade-database

To have launchd start postgresql now and restart at login:
brew services start postgresql
Or, if you don't want/need a background service you can just run:
pg_ctl -D /usr/local/var/postgres start
==> Summary
🍺 /usr/local/Cellar/postgresql/11.5_1: 3,189 files, 35.6MB
==> `brew cleanup` has not been run in 30 days, running now...
Pruned 4 symbolic links and 58 directories from /usr/local