When updating the dependency version in pyproject.toml, for example
[tool.poetry.dependencies]
python = “³.8.1”
streamlit = “⁰.51”. ## ==> update to 0.56
If there is already existing a poetry.lock
, poetry would throw
(streamlit-base) jackie@jackie streamlit-base % poetry install
Installing dependencies from lock file[NonExistentKey]
‘Key “hashes” does not exist.’install [-no-dev] [-dry-run] [-E|-extras EXTRAS] [-develop DEVELOP]
The reason being the hashes in the lock file doesn’t match the content with pyproject.tom.
The way to sort out this is to remove the lock file, then do the install again to generate a new file:
poetry install
Published
Originally published at https://lwpro2.dev on February 28, 2020.