Poetry dependency update

When updating the dependency version in pyproject.toml, for example

[tool.poetry.dependencies]
python = “^3.8.1”
streamlit = “^0.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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s