前提・実現したいこと
[Python] プログラム初心者のためのWebアプリ簡単作成法
上記2つの記事を参考にDjangoで作ったアプリをherokuにデプロイしようとしています。
発生している問題・エラーメッセージ
ターミナルにて
pip install gunicorn django-heroku
を実行したところ、下記のようなエラーが出ます。
Error: pg_config executable not found.
から、pg_configにPATHが通ってないのかなと思ったりしましたが、初学者のため、調べてもよく分からず、ご質問させていただいています。
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
このメッセージから、
sudo pip install psycopg2-binary
を実行して、再度
pip install gunicorn django-heroku
としても同じエラーが出ます。
Requirement already satisfied: gunicorn in ./env/lib/python3.6/site-packages (20.0.4) Collecting django-heroku Using cached django_heroku-0.3.1-py2.py3-none-any.whl (6.2 kB) Requirement already satisfied: setuptools>=3.0 in ./env/lib/python3.6/site-packages (from gunicorn) (45.2.0) Collecting psycopg2 Using cached psycopg2-2.8.4.tar.gz (377 kB) ERROR: Command errored out with exit status 1: command: /Users/yudai/Desktop/instant-django-master/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/pip-egg-info cwd: /private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/ Complete output (23 lines): running egg_info creating /private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/pip-egg-info/psycopg2.egg-info writing /private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO writing dependency_links to /private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt writing top-level names to /private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt writing manifest file '/private/var/folders/py/g02_syxj61n8bjwfdd0f2m740000gn/T/pip-install-3d4_qmnp/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt' Error: pg_config executable not found. pg_config is required to build psycopg2 from source. 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'. If you prefer to avoid building psycopg2 from source, please install the PyPI 'psycopg2-binary' package instead. For further information please check the 'doc/src/install.rst' file (also at <http://initd.org/psycopg/docs/install.html>). ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
試したこと
https://mutter.monotalk.xyz/posts/02036c1fb12aff1834291f47acca4fc9
https://qiita.com/Esfahan/items/9bf26c88d10d4f5faee5
など試しましたが、手詰まり状態です。
which pg_config
を実行しても、何も返ってきません。
ご教授お願いいたします。。
補足情報(FW/ツールのバージョンなど)
python 3.6.5
macOS 10.15.3
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。