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

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

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

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

Q&A

2回答

697閲覧

Python でデプロイする時のエラー

Ryocom

総合スコア6

Python

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

0グッド

1クリップ

投稿2018/03/30 06:23

前提・実現したいこと

Python でデプロイしたいです。

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

(myvenv) MacRyo:djangogirls ryousuke$ git push heroku master Counting objects: 24, done. Delta compression using up to 4 threads. Compressing objects: 100% (21/21), done. Writing objects: 100% (24/24), 6.18 KiB | 2.06 MiB/s, done. Total 24 (delta 2), 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 altgraph==0.10.2 (from -r /tmp/build_3a017f09d9e3c23d02eafb794942f032/requirements.txt (line 1)) remote: Downloading altgraph-0.10.2.tar.gz (481kB) remote: Collecting bdist-mpkg==0.5.0 (from -r /tmp/build_3a017f09d9e3c23d02eafb794942f032/requirements.txt (line 2)) remote: Downloading bdist_mpkg-0.5.0.tar.gz remote: Collecting bonjour-py==0.3 (from -r /tmp/build_3a017f09d9e3c23d02eafb794942f032/requirements.txt (line 3)) remote: Could not find a version that satisfies the requirement bonjour-py==0.3 (from -r /tmp/build_3a017f09d9e3c23d02eafb794942f032/requirements.txt (line 3)) (from versions: ) remote: No matching distribution found for bonjour-py==0.3 (from -r /tmp/build_3a017f09d9e3c23d02eafb794942f032/requirements.txt (line 3)) remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to ryocom. remote: To https://git.heroku.com/ryocom.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/ryocom.git'

デプロイするときにエラーが出てしまいます。

該当のソースコード

Python

試したこと

'''
remote: Could not find a version that satisfies the requirement bonjour-py==0.3 (from -r /tmp/build_3a017f09d9e3c23d02eafb794942f032/requirements.txt (line 3)) (from versions: )
remote: No matching distribution found for bonjour-py==0.3 (from -r /tmp/build_3a017f09d9e3c23d02eafb794942f032/requirements.txt (line 3))
'''
ここの問題を解決するために、sudo pip install bonjour-pyをしたり
一方でrequirement.txtのbonjour-pyを削除したりみたりしましたが効果はなく
このエラーが消えません。

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

初心者で、Djangoを使おうと思ってデプロイしようと思っています。
Mac OS sierra 10.12.6を使ってます。
Terminalを使っています。
virtualenv上で動かしています。
Herokuを使っています。
pipもインストール済みです。
pythonはバージョン3.6.4を使っています。

よろしくお願いします

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

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

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

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

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

Udomomo

2018/03/30 08:37

bonjour-pyをrequirements.txtから消した後、プッシュする前にコミットはしましたか?
Ryocom

2018/03/30 16:51

(myvenv) MacRyo:djangogirls ryousuke$ git commit -a # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch master # Changes to be committed: # modified: mysite/settings.py # modified: requirements.txt # # Untracked files: # pybonjour-python3/ # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "~/Python/djangogirls/.git/COMMIT_EDITMSG" 12L, 292C
Ryocom

2018/03/30 16:54

回答ありがとうございます!消した後にコミットした結果、上のような結果になってしまいました。。
guest

回答2

0

heroku config:set DISABLE_COLLECTSTATIC=1

と実行して、Heroku環境変数を設定してみてください。

投稿2018/04/28 02:25

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

0

コミットができてなさそうですね。
gitの基本的な使い方は、
・ファイルを編集
・git add -aで変更したファイル全てをステージング
・git commit -m "コミットメッセージ"でコミット
・git push heroku masterでプッシュ
という流れです。

投稿2018/03/31 01:24

Udomomo

総合スコア1524

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

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

Ryocom

2018/03/31 19:43

ありがとうございます!試して見たところおかげさまで、requirement.txtの問題は解決しました。 しかしながら、以下のようなエラーが出てしましました。 (myvenv) MacRyo:djangogirls ryousuke$ git push heroku master Counting objects: 32, done. Delta compression using up to 4 threads. Compressing objects: 100% (29/29), done. Writing objects: 100% (32/32), 6.86 KiB | 1.71 MiB/s, done. Total 32 (delta 8), 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 altgraph==0.10.2 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 1)) remote: Downloading altgraph-0.10.2.tar.gz (481kB) remote: Collecting bdist-mpkg==0.5.0 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 2)) remote: Downloading bdist_mpkg-0.5.0.tar.gz remote: Collecting dj-database-url==0.5.0 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 3)) remote: Downloading dj_database_url-0.5.0-py2.py3-none-any.whl remote: Collecting Django==1.11.11 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 4)) remote: Downloading Django-1.11.11-py2.py3-none-any.whl (6.9MB) remote: Collecting gunicorn==19.7.1 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 5)) remote: Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111kB) remote: Collecting macholib==1.5.1 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 6)) remote: Downloading macholib-1.5.1.tar.gz (454kB) remote: Collecting matplotlib==1.3.1 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 7)) remote: Downloading matplotlib-1.3.1.tar.gz (42.7MB) remote: Collecting modulegraph==0.10.4 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 8)) remote: Downloading modulegraph-0.10.4.tar.gz (532kB) remote: Collecting py2app==0.7.3 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 9)) remote: Downloading py2app-0.7.3.tar.gz (1.2MB) remote: Collecting pyobjc-core==2.5.1 (from -r /tmp/build_81c1b1b05da25d9c6035481460b85999/requirements.txt (line 10)) remote: Downloading pyobjc-core-2.5.1.tar.gz (2.1MB) remote: Complete output from command python setup.py egg_info: remote: You're not running on MacOS X, and don't use GNUstep remote: I don't know how to build PyObjC on such a platform. remote: Please read the ReadMe. remote: remote: ObjC runtime not found remote: remote: ---------------------------------------- remote: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-96nhxw4w/pyobjc-core/ remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to ryocom. remote: To https://git.heroku.com/ryocom.git/ ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/ryocom.git/' これに対して、pip install --upgrade setuptoolsを行っ他のですが、効果はなく、GNUstepはインストールも試したのですが、こちらはGNUstep自体のインストールがうまく行きませんでした。 何かアドバイスいただければ嬉しいです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問