在MacOSX上安装Django-toolbelt时出现错误



我试图按照Heroku的教程来部署Django应用程序。我从虚拟环境中这样做,按照教程(https://devcenter.heroku.com/articles/getting-started-with-django),并且已经到了我输入的点:

pip install django-toolbelt

当我尝试安装django-toolbelt时,我得到以下错误信息:

Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.

我试过从源代码下载PostgreSQL并自己编译它,我试过从django-toolbelt单独下载psycopg2,然后进入psycopg2文件夹并添加pg_config的特定路径文件。我发现了一个旧线程(尝试在python virtualenv中安装django-toolkit时出现错误),似乎描述了相同的问题,我已经尝试了该帖子上提供的解决方案,并得到了相同的错误信息。我不清楚那个问题的原始海报是否找到了解决问题的方法,但我希望有人能有一个想法。

有没有人觉得这听起来很熟悉?我在这方面还是个新手,而且在这一点上我也没有什么好主意可以尝试。感谢您的阅读和任何您可以提供的帮助!

这为我修复了它:http://schalk-neethling.co.za/2015/01/resolving-error-pg_config-executable-not-found-on-mac/

    安装postgresql
  • export PATH=/usr/local/Cellar/postgresql/9.4.0/bin:$PATH注意:检查你的版本号
  • 安装psycopg2

最新更新