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

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

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

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Python

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

Q&A

解決済

1回答

1622閲覧

Herokuへのデプロイができない [ERROR]:Failed building wheel for twisted-iocpsupport等

kabos0809

総合スコア3

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Python

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

0グッド

0クリップ

投稿2021/10/28 15:17

編集2021/10/28 15:19

Herokuへのデプロイができなくて困っています。requirements.txt, Procfileは作成してあります。

requirements

1asgiref==3.3.4 2attrs==21.2.0 3Automat==20.2.0 4beautifulsoup4==4.9.3 5boto3==1.19.3 6botocore==1.22.3 7certifi==2020.12.5 8cffi==1.14.5 9chardet==4.0.0 10constantly==15.1.0 11cryptography==3.4.7 12cssselect==1.1.0 13Django==3.2.3 14django-bootstrap4==2.3.1 15django-taggit==1.5.1 16django-widget-tweaks==1.4.8 17h2==3.2.0 18hpack==3.0.0 19hyperframe==5.2.0 20hyperlink==21.0.0 21idna==2.10 22incremental==21.3.0 23itemadapter==0.2.0 24itemloaders==1.0.4 25jmespath==0.10.0 26lxml==4.6.3 27mysqlclient==2.0.3 28oauthlib==3.1.1 29parsel==1.6.0 30Pillow==8.3.2 31priority==1.3.0 32Protego==0.1.16 33pyasn1==0.4.8 34pyasn1-modules==0.2.8 35pycparser==2.20 36PyDispatcher==2.0.5 37pyOpenSSL==20.0.1 38python-dateutil==2.8.2 39python-lambda-local==0.1.12 40pytz==2021.1 41queuelib==1.6.1 42requests==2.25.1 43requests-oauthlib==1.3.0 44s3transfer==0.5.0 45schedule==1.1.0 46Scrapy==2.5.0 47service-identity==21.1.0 48six==1.16.0 49soupsieve==2.2.1 50sqlparse==0.4.1 51tweepy==4.1.0 52Twisted==21.2.0 53twisted-iocpsupport==1.0.1
remote: Building wheel for twisted-iocpsupport (PEP 517): started remote: Building wheel for twisted-iocpsupport (PEP 517): finished with status 'error' remote: ERROR: Command errored out with exit status 1: remote: command: /app/.heroku/python/bin/python /app/.heroku/python/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpofykbpd1 remote: cwd: /tmp/pip-install-5t_7x786/twisted-iocpsupport remote: Complete output (13 lines): remote: running bdist_wheel remote: running build remote: running build_ext remote: building 'twisted_iocpsupport.iocpsupport' extension remote: creating build remote: creating build/temp.linux-x86_64-3.9 remote: creating build/temp.linux-x86_64-3.9/twisted_iocpsupport remote: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Itwisted_iocpsupport -I/app/.heroku/python/include/python3.9 -c twisted_iocpsupport/iocpsupport.c -o build/temp.linux-x86_64-3.9/twisted_iocpsupport/iocpsupport.o remote: twisted_iocpsupport/iocpsupport.c:641:10: fatal error: io.h: No such file or directory remote: 641 | #include "io.h" remote: | ^~~~~~ remote: compilation terminated. remote: error: command '/usr/bin/gcc' failed with exit code 1 remote: ---------------------------------------- remote: ERROR: Failed building wheel for twisted-iocpsupport remote: Successfully built mysqlclient Protego PyDispatcher remote: Failed to build twisted-iocpsupport remote: ERROR: Could not build wheels for twisted-iocpsupport which use PEP 517 and cannot be installed directly remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: fd19a98d610bda9909b1082286dcf6ea8cdb7a29 remote: ! remote: ! We have detected that you have triggered a build from source code with version fd19a98d610bda9909b1082286dcf6ea8cdb7a29 remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run: remote: ! remote: ! git push heroku <branchname>:main remote: ! remote: ! This article goes into details on the behavior: remote: ! https://devcenter.heroku.com/articles/duplicate-build-version remote: remote: Verifying deploy... remote: remote: ! Push rejected to powerful-hollows-10870. remote: To https://git.heroku.com/powerful-hollows-10870.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/powerful-hollows-10870.git'

エラーメッセージは以上の通りです。

試したこと

$git checkout masterをして$git pull origin masterをしようとしてもfailedとなり失敗。
本ブランチはmasterです。

herokuを使うのが初めてで行き詰まっています。有識者の方ご教授願います。

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

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

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

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

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

guest

回答1

0

ベストアンサー

twisted-iocpsupportはWindows向けのパッケージで、おそらくHerokuでは動かせません。
(Herokuの動作環境はLinuxのため)

GitHubの説明<URL>より

Protected Twisted package. A cython extension for Windows IOCP network related API. It provided the minimal helpers to implement the Twisted IOCP reactor.

参考

投稿2021/10/28 16:19

attakei

総合スコア2738

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

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

kabos0809

2021/10/28 17:54

回答ありがとうございます。参考先を拝見したところtwisted_iocpsupportを削除するとあったのですが、イマイチどうしたら良いのかわからなかったので、どうやってtwisted_iocpsupportを削除すればいいのか教えていただけないでしょうか??
attakei

2021/10/29 01:23

Herokuはrequirements.txtを見ているだけなので、単純に削除するならtwisted-iocpsupportの行をrequirements.txtから消すだけです。 そうすれば、少なくともtwisted-iocpsupportをインストールしようとすることはありません。 当然ながら、もともとrequirementsとしてリストに含まれたものを消す以上は、アプリケーションが正常に機能しなくなるかもしれません。 その可能性を十分に考慮する必要があります。
kabos0809

2021/10/29 03:18

requirements.txt からtwisted_iocpsupportを削除したのですがなぜかデプロイの段階でtwisted_iocpsupportが再度インストールされてしまい、その後エラーとなります。requirements.txtを変更した場合に実行するコマンドなどありますか??
attakei

2021/10/29 04:54

コメント含め目に見える範囲で想像できるのは、以下の2点です。 <1. twisted-iocpsupportに依存するパッケージが別に存在する> requirements.txtにリストアップされているパッケージの中にtwisted-iocpsupportを必要とするものがあった場合、パッケージの依存関係の解決タイミングでインストール対象としてtwisted-iocpsupportが含まれてしまいます。 該当するものがあるなら、こちらも削除する必要があります。 <2. requirements.txtの変更をローカルでしか行っていない> もとの質問文に則って説明すると、必要な変更をcommitたうえでherokuにpushしない限り、変更したrequirements.txtに基づくセットアップ処理は行われません。 (↑コメントだと「削除した」がローカルで削除しただけとも読み取れる) Herokuのドキュメントなどを元に、反映を行う必要があります。
kabos0809

2021/10/29 05:42

ご指摘の通りcommitを行っておらず、ローカルリポジトリのみでの変更となっていました。また、一度appを作り直すことでversionが重複しているというエラーを解消することができました。これらを修正したことで、デプロイを完了することができました。いろいろ教えていただき、本当にありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問