poetry: [development] Unable to install poetry's dependencies
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: macOS High Sierra 10.13
- Poetry version:
0.12.17
- Link of a Gist with the contents of your pyproject.toml file: It’s this repo, self.
Issue
Following CONTRIBUTING.md
, I cloned and cd'd
into the repo and then when I run poetry install
I get:
Installing dependencies from lock file
[NonExistentKey]
'Key "hashes" does not exist.'
install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]
In verbose mode:
Using virtualenv: /Users/<user>/Library/Caches/pypoetry/virtualenvs/poetry-py3.7
Installing dependencies from lock file
[NonExistentKey]
'Key "hashes" does not exist.'
Exception trace:
/Users/<user>/.poetry/lib/poetry/_vendor/py3.7/cleo/application.py in run() at line 94
status_code = self.do_run(input_, output_)
/Users/<user>/.poetry/lib/poetry/console/application.py in do_run() at line 88
return super(Application, self).do_run(i, o)
/Users/<user>/.poetry/lib/poetry/_vendor/py3.7/cleo/application.py in do_run() at line 197
status_code = command.run(input_, output_)
/Users/<user>/.poetry/lib/poetry/console/commands/command.py in run() at line 77
return super(BaseCommand, self).run(i, o)
/Users/<user>/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/base_command.py in run() at line 146
status_code = self.execute(input_, output_)
/Users/<user>/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py in execute() at line 107
return self.handle()
/Users/<user>/.poetry/lib/poetry/console/commands/install.py in handle() at line 55
return_code = installer.run()
/Users/<user>/.poetry/lib/poetry/installation/installer.py in run() at line 73
self._do_install(local_repo)
/Users/<user>/.poetry/lib/poetry/installation/installer.py in _do_install() at line 169
locked_repository = self._locker.locked_repository(True)
/Users/<user>/.poetry/lib/poetry/packages/locker.py in locked_repository() at line 86
package.hashes = lock_data["metadata"]["hashes"][info["name"]]
/Users/<user>/.poetry/lib/poetry/_vendor/py3.7/tomlkit/items.py in __getitem__() at line 981
return self._value[key]
/Users/<user>/.poetry/lib/poetry/_vendor/py3.7/tomlkit/container.py in __getitem__() at line 524
raise NonExistentKey(key)
install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]
Also, this occurs with both Python 3.7 and Python 2.7.
I went like 10 commits back and it still occurred, as did with 20 commits back, and 25 commits back. Eventually I narrowed it down to https://github.com/sdispater/poetry/commit/e54f3907f1e110813b690febcfb89ebd75224bea being the root cause. The commit before that (or more before it) work fine and poetry install
works on them.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 10
- Comments: 25 (3 by maintainers)
Commits related to this issue
- Working around poetry bug: https://github.com/sdispater/poetry/issues/1510\#issuecomment-549578924 — committed to alichtman/shallow-backup by alichtman 5 years ago
- ci: use poetry preview See sdispater/poetry#1510 — committed to msiemens/tinydb by msiemens 5 years ago
- Apply hack from https://github.com/sdispater/poetry/issues/1510#issuecomment-549578924 — committed to moigagoo/cliar by moigagoo 5 years ago
- Working around poetry bug: https://github.com/sdispater/poetry/issues/1510\#issuecomment-549578924 — committed to alichtman/shallow-backup by alichtman 5 years ago
If you delete the lock and regenerate should fix the problem.
@b0g3r yep, using
1.0.0b3
worked to install. That leads to a few follow-ups though:0.12.17
)? Not sure if it was intentional / meant to break compat or not.pyproject.toml
, Poetry doesn’t actually specify abuild-system
, which would normally list which version ofpoetry
it depends on to work. I’m assuming there’s a reason for that, but that would be the root cause of this type of issue, no?CONTRIBUTING.md
. I can add a PR for that, but not sure what the min version required to usemaster
is (and if that differs fordevelop
).FYI: using poetry installed by pip did not work too, even with the cmd above. I just
pip
uninstall it and reinstall with the recommanded waycurl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
and it worked again!The occurrence of lock-file incompatilibities is exactly what I envisioned to be handled more gracefully when proposing #1410. Maybe that is something worth picking up?
Unfortunately yes… In fact 1.0.0 is compatible with 0.12.x lock format but not the other way around.
https://github.com/python-poetry/poetry/issues/1410
@finswimmer does that solve #1523 as well? That was labeled as a duplicate of this issue, but it seems like users of poetry were affected as well (not just contributors of poetry), especially after seeing all the related issues pop up here. That might be due to the lockfile incompatibility?
I haven’t seen this in my own usage of poetry outside of here, so I’m not really sure exactly how those folks happen upon this error. Possibly #1523 should be reopened as a separate, but related issue, or this one should be renamed given all the links here. Hopefully someone else can chime in who has experienced it outside of contributing.
Temporary hack for installing dependencies: