質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Django

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

1回答

219閲覧

【DjangoGirlsTutorial】herokuのデプロイでエラーが発生しています。

y_y.

総合スコア16

Django

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

1クリップ

投稿2018/04/23 14:08

前提・実現したいこと

DjangoGirlsTutorial というサイトに従い、Django の学習を進めているものです。
「デプロイ」という項目で、$ git push heroku master を実行したところ、以下のエラーが発生しました。
お分かりになる方、ご教授頂けますでしょうか。

https://djangogirlsjapan.gitbooks.io/workshop_tutorialjp/django_start_project/

発生している問題・エラーメッセージ

Counting objects: 21, done. Delta compression using up to 4 threads. Compressing objects: 100% (18/18), done. Writing objects: 100% (21/21), 6.25 KiB | 2.08 MiB/s, done. Total 21 (delta 1), 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.4 (you are using python-3.5.2, which is unsupported). remote: ! We recommend upgrading by specifying the latest version (python-3.6.4). 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_53f9cae3179d30d0fc6c15e24fe91cce/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.8.19 (from -r /tmp/build_53f9cae3179d30d0fc6c15e24fe91cce/requirements.txt (line 2)) remote: Downloading https://files.pythonhosted.org/packages/96/b9/b4108da1275dc2ac1bba1e87739cb31b3d44339affb83b0e949fb09c2bef/Django-1.8.19-py2.py3-none-any.whl (6.2MB) remote: Collecting gunicorn==19.7.1 (from -r /tmp/build_53f9cae3179d30d0fc6c15e24fe91cce/requirements.txt (line 3)) remote: Downloading https://files.pythonhosted.org/packages/64/32/becbd4089a4c06f0f9f538a76e9fe0b19a08f010bcb47dcdbfbc640cdf7d/gunicorn-19.7.1-py2.py3-none-any.whl (111kB) remote: Collecting whitenoise==3.3.1 (from -r /tmp/build_53f9cae3179d30d0fc6c15e24fe91cce/requirements.txt (line 4)) 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_53f9cae3179d30d0fc6c15e24fe91cce/requirements.txt (line 5)) 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-hbu7uqqv/psycopg2/ remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to djangogirlsblog-yance. remote: To https://git.heroku.com/djangogirlsblog-yance.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/djangogirlsblog-y.git'

該当のソースコード

(myvenv) MacBook-Pro:djangogirls yy$ git push heroku master

試したこと

$ pip install psycopg2 でバージョンを上げて $ pip freeze > requirements.txt で保存したのですが、依然としてエラーが出てしまいます。

また、DjangoGirlsTutorial 内で作成した runtime.txt の内容も python-3.6.4
に変更したのですが、下記の部分が出続けています。

remote: ! The latest version of Python 3 is python-3.6.4 (you are using python-3.5.2, which is unsupported). remote: ! We recommend upgrading by specifying the latest version (python-3.6.4).

補足情報(FW/ツールのバージョンなど)

python 3.6.4
mac OS


宜しくお願い致します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

bluevinyl

2018/04/23 15:33

ファイル修正した後gitでaddとcommitはしましたか?
y_y.

2018/04/26 13:17

回答いただきありがとうございます。git add . と git commit -a -m を行った後に、 git push heroku master を行ったのですが、上記と同様のエラーが発生しました。
guest

回答1

0

ベストアンサー

Collecting psycopg2==2.5.4 (from -r /tmp/build_53f9cae3179d30d0fc6c15e24fe91cce/requirements.txt (line 5))
をやっているときに、
Error: could not determine PostgreSQL version from '10.3'
このエラーです。

解決策はpsycopg2のバージョン変更。
2.7.1へ。
https://stackoverflow.com/questions/49291428/error-could-not-determine-postgresql-version-from-10-3-django-on-heroku

投稿2018/04/23 22:31

mkgrei

総合スコア8560

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

y_y.

2018/04/26 13:19

回答いただきありがとうございます。 ファイル内の記述を psycopg2==2.7.4 と書き換え、git add . と git commit -a -m を行った後に、 git push heroku master を行ったのですが、上記と同様のエラーが発生しました
y_y.

2018/04/26 13:35

git add . git commit -m "comment" を行った後に git push heroku master を行い、デプロイする事が出来ました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問