bash
1$ pipenv install marshmallow==2.21.0 2... 3[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies. 4 First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again. 5 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation. 6 Hint: try $ pipenv lock --pre if it is a pre-release dependency. 7ERROR: ERROR: Could not find a version that matches marshmallow<4,<4.0.0,==2.21.0,>=3,>=3.0.0 8...
まっさらなUbuntu18.04で上記エラーがでるのですが、marshmallowをpipenvでインストールするにはどのようにすればよいのでしょうか?
> pipenv install marshmallow==2.21.0
最新版は3.15.0ですが、
https://pypi.org/project/marshmallow/
2.21.0をインストールしないといけない理由があるのでしょうか?
> marshmallow<4,<4.0.0,==2.21.0,>=3,>=3.0.0
質問者さんが指定してる2.21.0が、「3以上4未満」と矛盾してる、ということかな?
pipenv graph --reverse
を実行して、marshmallowのところを見てください
何かがmarshmallowが「3以上4未満」であることを要求してませんでしょうか?
> 2.21.0をインストールしないといけない理由があるのでしょうか?
とあるミドルウェアの環境構築をしたいのですが、それ自体が古すぎて依存ライブラリであるmarshmallowも古いバージョンでなくてはならない、という理由です。
pipenv graph --reverseの結果、
- marshmallow-oneofschema==3.0.1 [requires: marshmallow>=3.0.0,<4.0.0]
とありました。
> marshmallow-oneofschema==3.0.1 [requires: marshmallow>=3.0.0,<4.0.0]
marshmallow 2.21.0との組み合わせで使える古いmarshmallow-oneofschemaをインストールしないといけないようです
ただし、marshmallow-oneofschemaのバージョンが3.0.1であることを必要としてるものがないか、「pipenv graph --reverse」の結果のmarshmallow-oneofschemaのところを確認してください
【追記】
https://github.com/marshmallow-code/marshmallow-oneofschema/blob/v1.0.0/setup.py
や
https://github.com/marshmallow-code/marshmallow-oneofschema/blob/v1.0.6/setup.py
を見ると、marshmallow-oneofschema 1.*ならば、marshmallow 2.21.0との組み合わせで使えるようです