前提・実現したいこと
Django を Heroku でデプロイしたい。
使っているツールのバージョンなど補足情報
Windows10
Python 3.8.5
Django 4.0.5
django-heroku 0.3.1
発生している問題・エラーメッセージ
Ubuntu
1××××@DESKTOP-1MQ5361:/mnt/c/Users/××××/Desktop/myproject$ git push heroku master 2Enumerating objects: 46, done. 3Counting objects: 100% (46/46), done. 4Delta compression using up to 4 threads 5Compressing objects: 100% (43/43), done. 6Writing objects: 100% (46/46), 24.23 KiB | 50.00 KiB/s, done. 7Total 46 (delta 2), reused 0 (delta 0) 8remote: Compressing source files... done. 9remote: Building source: 10remote: 11remote: -----> Building on the Heroku-20 stack 12remote: -----> Determining which buildpack to use for this app 13remote: -----> Python app detected 14remote: -----> No Python version was specified. Using the buildpack default: python-3.10.5 15remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes 16remote: -----> Installing python-3.10.5 17remote: -----> Installing pip 22.1.2, setuptools 60.10.0 and wheel 0.37.1 18remote: -----> Installing SQLite3 19remote: -----> Installing requirements with pip 20remote: Processing /C:/ci/argon2-cffi_1596828585465/work 21remote: ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/C:/ci/argon2-cffi_1596828585465/work' 22remote: 23remote: ! Push rejected, failed to compile Python app. 24remote: 25remote: ! Push failed 26remote: ! 27remote: ! ## Warning - The same version of this code has already been built: ab8dedeae8cbff64cbe2cdc36877d6b14809f06e 28remote: ! 29remote: ! We have detected that you have triggered a build from source code with version ab8dedeae8cbff64cbe2cdc36877d6b14809f06e 30remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. 31remote: ! 32remote: ! If you are developing on a branch and deploying via git you must run: 33remote: ! 34remote: ! git push heroku <branchname>:main 35remote: ! 36remote: ! This article goes into details on the behavior: 37remote: ! https://devcenter.heroku.com/articles/duplicate-build-version 38remote: 39remote: Verifying deploy... 40remote: 41remote: ! Push rejected to ×××××××××××××. 42remote: 43To https://git.heroku.com/×××××××××××××.git 44 ! [remote rejected] master -> master (pre-receive hook declined) 45error: failed to push some refs to 'https://git.heroku.com/×××××××××××××.git'
自分で調べたことや試したこと
【Django】Herokuへデプロイしアプリを公開 の通りに試してみました。
runtime.txtファイルを作成の際に、 Python
のバージョンが 3.8.5
であり、 HerokuのRuntimeのサポート の対象外であることが判明したため、 Python3.10.5
をインストールしました。その後に下記のコマンドを実行しました。
command
1C:\Users\×××>python -V 2Python 3.8.5 3 4C:\Users\×××>where python 5C:\Users\×××\anaconda3\python.exe 6C:\Users\×××\AppData\Local\Programs\Python\Python310\python.exe 7C:\Users\×××\AppData\Local\Microsoft\WindowsApps\python.exe
結果、 $ python -V
コマンドでのバージョンは変わっていませんでした。
$ where python
では2行目に Python 3.10.5 のパスがあることが確認できます。
この状態で再度 $ git push heroku master
しても同じエラーメッセージが表示されました。
Python のバージョンが Heroku に対応していないのがエラーの要因でしょうか?
どうやったら改善できるでしょうか?
あなたの回答
tips
プレビュー