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

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

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

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

Python

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

Q&A

解決済

2回答

2102閲覧

git push heroku masterでpywin32のエラーが出てpush出来ない

bridgebook

総合スコア3

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

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

Python

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

0グッド

0クリップ

投稿2021/08/27 15:37

編集2021/08/27 15:43

前提・実現したいこと

pythonで作成したtwitterbotをherokuで動かしたが、git push heroku masterで
エラーが出てpushが出来ない。

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

remote: ERROR: Could not find a version that satisfies the requirement pywin32==301 (from -r /tmp/build_c1b78cf4/requirements.txt (line 73)) (from versions: none) remote: ERROR: No matching distribution found for pywin32==301 (from -r /tmp/build_c1b78cf4/requirements.txt (line 73)) 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: 1ab570ebede9b4e2cbc7a089a11d67511154bf96 remote: ! remote: ! We have detected that you have triggered a build from source code with version 1ab570ebede9b4e2cbc7a089a11d67511154bf96 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 isurrender. remote: To https://git.heroku.com/isurrender.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/isurrender.git' C:\Users\user\Documents\twitter_bot>

該当のソースコード

python 3.9.5

1git push heroku master

試したこと

requirements.txtからpywin32の行を削除するも変わらず。pywin32をアンインストールするも同じエラーメッセージが出ている状況です。

### 補足説明
requirements.txtの内容は以下です。

anyio==3.3.0 argon2-cffi==20.1.0 async-generator==1.10 attrs==21.2.0 Babel==2.9.1 backcall==0.2.0 bleach==3.3.1 cachetools==4.2.2 certifi==2021.5.30 cffi==1.14.6 charset-normalizer==2.0.3 colorama==0.4.4 cycler==0.10.0 debugpy==1.4.1 decorator==5.0.9 defusedxml==0.7.1 entrypoints==0.3 google-auth==1.34.0 google-auth-oauthlib==0.4.4 gspread==3.7.0 httplib2==0.19.1 idna==3.2 ipykernel==6.0.3 ipython==7.25.0 ipython-genutils==0.2.0 ipywidgets==7.6.3 jedi==0.18.0 Jinja2==3.0.1 json5==0.9.6 jsons==1.5.0 jsonschema==3.2.0 jupyter==1.0.0 jupyter-client==6.1.12 jupyter-console==6.4.0 jupyter-core==4.7.1 jupyter-server==1.10.1 jupyterlab==3.0.16 jupyterlab-pygments==0.1.2 jupyterlab-server==2.6.1 jupyterlab-widgets==1.0.0 kiwisolver==1.3.1 lab==6.4 MarkupSafe==2.0.1 matplotlib==3.4.2 matplotlib-inline==0.1.2 mistune==0.8.4 nbclassic==0.3.1 nbclient==0.5.3 nbconvert==6.1.0 nbformat==5.1.3 nest-asyncio==1.5.1 notebook==6.4.0 numpy==1.21.1 oauth2client==4.1.3 oauthlib==3.1.1 packaging==21.0 pandocfilters==1.4.3 parso==0.8.2 pickleshare==0.7.5 Pillow==8.3.1 prometheus-client==0.11.0 prompt-toolkit==3.0.19 psycopg2==2.9.1 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycparser==2.20 Pygments==2.9.0 pyparsing==2.4.7 pyrsistent==0.18.0 python-dateutil==2.8.2 python-dotenv==0.19.0 pytz==2021.1 pywin32==301 pywinpty==1.1.3 pyzmq==22.1.0 qtconsole==5.1.1 QtPy==1.9.0 requests==2.26.0 requests-oauthlib==1.3.0 requests-unixsocket==0.2.0 rsa==4.7.2 selenium==3.141.0 Send2Trash==1.7.1 simplejson==3.17.3 six==1.16.0 sniffio==1.2.0 terminado==0.10.1 testpath==0.5.0 tornado==6.1 traitlets==5.0.5 txt2tags==3.7 typish==1.9.2 urllib3==1.26.5 wcwidth==0.2.5 webencodings==0.5.1 websocket-client==1.1.0 widgetsnbextension==3.5.1

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

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

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

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

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

guest

回答2

0

ベストアンサー

requirements.txtからpywin32の行を削除するも変わらず。pywin32をアンインストールするも同じエラーメッセージが出ている状況です。

おそらく pip freeze > requirements.txt のように実行したのだと予想しますが、
プロジェクトに関係なくこれまで pip install したものがすべて入ってしまっていると思います。
requirements.txt の内容をプロジェクトを実行するために必要なものだけに整理してコミットしましょう。

投稿2021/08/27 17:35

mather

総合スコア6753

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

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

bridgebook

2021/08/31 01:34

ご回答ありがとうございました。requirementsの記述をひとつずつなめて、取捨選択した結果、正常にpushができました。
guest

0

heroku のサーバーは Windows じゃないので pywin32 を要求するとエラーになります。

Herokuにデプロイしたい と同様に解決できると思いますよ。

投稿2021/08/27 16:21

bboydaisuke

総合スコア5275

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

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

bridgebook

2021/08/31 01:35

リンク先の質問を参考に対応したところ、無事に解決しました。ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.47%

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

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

質問する

関連した質問