Help us understand the problem. What is going on with this article?

heroku python3 →もしかして: 空白?

More than 3 years have passed since last update.

virtualenvを知ってから、ローカルでpython2とpython3を切り替えたりしながら作業してて楽しい。けれども、pythonのバージョン変えてherokuにdeployするというのをさっき初めてやってみて30分くらいかかったので、今後のためにメモしておく。

目的: python2で作っていたherokuアプリをpython3に変更する。

方法: アプリのルートに"runtime.txt"というファイルを置く。それだけ。中身は、

runtime.txt
python-3.4.2

と書くだけ。

で、はまってたのは一行目を空白で改行してたから!

エラー(一部抜粋)はこんな感じ。

remote: -----> Python app detected
remote: -----> Found runtime python-2.7.9, removing
remote: -----> Installing runtime (
remote: python-3.4.2)
remote:  !     Requested runtime (
remote: python-3.4.2) is not available for this stack (cedar-14).
remote:  !     Aborting.  More info: https://devcenter.heroku.com/articles/python-support
remote: 
remote:  !     Push rejected, failed to compile Python app

バージョン指定を調べ直したり(https://devcenter.heroku.com/articles/python-runtimes)
して、それから空白行に気づいた。慣れないvimで書いてた。

あと、pythonのバージョン変えたらpip freeze > requirements.txtをするのもわすれないこと。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした