以下のサイトに沿ってDjangoのデプロイに取り組んでいます。
Djangoのカリキュラム
デプロイをするために、プッシュするもエラーが発生してしまいます。
$ git push heroku master
Counting objects: 20, done. Delta compression using up to 4 threads. Compressing objects: 100% (17/17), done. Writing objects: 100% (20/20), 4.46 KiB | 1.49 MiB/s, done. Total 20 (delta 0), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Python app detected remote: ! The latest version of Python 3 is python-3.6.5 (you are using python-3.5.2, which is unsupported). remote: ! We recommend upgrading by specifying the latest version (python-3.6.5). remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes remote: -----> Installing python-3.5.2 remote: -----> Installing pip remote: -----> Installing requirements with pip remote: Collecting dj-database-url==0.5.0 (from -r /tmp/build_df8021fe7360c6eacd0f4d6940692665/requirements.txt (line 1)) remote: Downloading https://files.pythonhosted.org/packages/d4/a6/4b8578c1848690d0c307c7c0596af2077536c9ef2a04d42b00fabaa7e49d/dj_database_url-0.5.0-py2.py3-none-any.whl remote: Collecting Django==1.11 (from -r /tmp/build_df8021fe7360c6eacd0f4d6940692665/requirements.txt (line 2)) remote: Downloading https://files.pythonhosted.org/packages/47/a6/078ebcbd49b19e22fd560a2348cfc5cec9e5dcfe3c4fad8e64c9865135bb/Django-1.11-py2.py3-none-any.whl (6.9MB) remote: Collecting gunicorn==19.8.1 (from -r /tmp/build_df8021fe7360c6eacd0f4d6940692665/requirements.txt (line 3)) remote: Downloading https://files.pythonhosted.org/packages/55/cb/09fe80bddf30be86abfc06ccb1154f97d6c64bb87111de066a5fc9ccb937/gunicorn-19.8.1-py2.py3-none-any.whl (112kB) remote: Collecting pytz==2018.4 (from -r /tmp/build_df8021fe7360c6eacd0f4d6940692665/requirements.txt (line 4)) remote: Downloading https://files.pythonhosted.org/packages/dc/83/15f7833b70d3e067ca91467ca245bae0f6fe56ddc7451aa0dc5606b120f2/pytz-2018.4-py2.py3-none-any.whl (510kB) remote: Collecting whitenoise==3.3.1 (from -r /tmp/build_df8021fe7360c6eacd0f4d6940692665/requirements.txt (line 5)) remote: Downloading https://files.pythonhosted.org/packages/0c/58/0f309a821b9161d0e3a73336a187d1541c2127aff7fdf3bf7293f9979d1d/whitenoise-3.3.1-py2.py3-none-any.whl remote: Collecting psycopg2==2.5.4 (from -r /tmp/build_df8021fe7360c6eacd0f4d6940692665/requirements.txt (line 6)) remote: Downloading https://files.pythonhosted.org/packages/63/c3/802668cb3cfc2880c2a8364623e7105a0257724a2612bb66ec733aaddb8c/psycopg2-2.5.4.tar.gz (682kB) remote: Complete output from command python setup.py egg_info: remote: running egg_info remote: creating pip-egg-info/psycopg2.egg-info remote: writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt remote: writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt remote: writing pip-egg-info/psycopg2.egg-info/PKG-INFO remote: writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt' remote: Error: could not determine PostgreSQL version from '10.3' remote: remote: ---------------------------------------- remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hyexa91l/psycopg2/ remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to ayblog. remote: To https://git.heroku.com/ayblog.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/ayblog.git'
エラー文としては
Error: could not determine PostgreSQL version from '10.3'
や、
** Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hyexa91l/psycopg2/**
などがあるので、データベース関連のpip?などに問題があるのかと睨んでいます。
psycopg2 のバージョンが合ってないなどの可能性はあるでしょうか?
おわかりの方がいましたら、アドバイスをいただけますと幸いです。
追記:
requirements.txtに以下のとおり、psycopg2==2.7.4 を指定しました。
dj-database-url==0.5.0 Django==1.11 gunicorn==19.8.1 pytz==2018.4 whitenoise==3.3.1 psycopg2==2.7.4
そして、ターミナルで以下を実行します。
$ pip install psycopg2 Collecting psycopg2 Using cached https://files.pythonhosted.org/packages/8c/a5/0e61d6f4a140a6e06a9ba40266c4b49123d834f1f97fe9a5ae0b6e45112b/psycopg2-2.7.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Installing collected packages: psycopg2 Successfully installed psycopg2-2.7.4
$git push heroku master
を実行しましたが、上記と同じエラーの状態です。
バージョン指定になにか問題があるのでしょうか?
追記:
$ git push heroku master 中略 Collecting psycopg2==2.5.4 (from -r /tmp/build_913e4d05229c1e72f99624d15a3471d5/requirements.txt (line 6)) remote: Downloading https://files.pythonhosted.org/packages/63/c3/802668cb3cfc2880c2a8364623e7105a0257724a2612bb66ec733aaddb8c/psycopg2-2.5.4.tar.gz (682kB) remote: Complete output from command python setup.py egg_info: remote: running egg_info remote: creating pip-egg-info/psycopg2.egg-info remote: writing pip-egg-info/psycopg2.egg-info/PKG-INFO remote: writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt remote: writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt remote: writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt' remote: Error: could not determine PostgreSQL version from '10.3' remote: remote: ---------------------------------------- remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_zleh1xw/psycopg2/ remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to ayblog. remote: To https://git.heroku.com/ayblog.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/ayblog.git'
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/09 23:00 編集
退会済みユーザー
2018/05/10 00:36
2018/05/10 06:48