解決の記録1: 不要なパッケージのアンインストール
Cloud Functionsを利用中に以下のエラーに出くわしました。
ERROR: Cannot install -r requirements.txt (line 138) and protobuf==4.21.6
because these package versions have conflicting dependencies.
The conflict is caused by: The user requested protobuf==4.21.6
tensorboard 2.10.0 depends on protobuf<3.20 and >=3.9.2
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible
パッケージのprotobufとtensorboardの間で依存関係のエラーが発生しているようでした。
protobufのバージョンは3.20.1でインストールしてみたのですが、別のパッケージとの依存関係で問題となってしまいprotobufのバージョンアップでは対処できませんでした。
色々試行錯誤した状態でrequirements.txtを作成していたため、一旦tensorboardをアンインストールしてみました。
pip uninstall tensorboard
現在のスクリプトではtensorboardを利用していなかったようで、問題なく動くようになりました!
解決した記録2: パッケージのダウングレード
Cloud Functionsを利用中に以下のエラーに出くわしました。
found incompatible dependencies:
"functions-framework 3.0.0 has requirement watchdog<2.0.0,>=1.0.0, but you have watchdog 2.1.9.
パッケージのfunctions-frameworkとwatchdogの間で依存関係のエラーが発生しているようでした。
エラーメッセージで言われている通り、watchdogのバージョンを指定してダウングレードしてみます。。
pip install watchdog==1.0.0
エラーは無事解消されました!