{"id":1125,"hash":"e1df077d7d2d94f57e49cef56bb48c8fb6d486974a26aab242610441acf951fb","pattern":"Poetry install on an existing project Error &quot;does not contain any element&quot;","full_message":"I am using Poetry for the first time.\nI have a very simple project. Basically\n\na_project\n|\n|--test\n|    |---test_something.py\n|\n|-script_to_test.py\n\nFrom a project I do poetry init and then poetry install\n\nI get the following\n\n poetry install\nUpdating dependencies\nResolving dependencies... (0.5s)\n\nWriting lock file\n\nPackage operations: 7 installs, 0 updates, 0 removals\n\n  • Installing attrs (22.2.0)\n  • Installing exceptiongroup (1.1.0)\n  • Installing iniconfig (2.0.0)\n  • Installing packaging (23.0)\n  • Installing pluggy (1.0.0)\n  • Installing tomli (2.0.1)\n  • Installing pytest (7.2.1)\n\n/home/me/MyStudy/2023/pyenv_practice/dos/a_project/a_project does not contain any element\n\nafter this I can run poetry run pytest without problem but what does that error message mean?","ecosystem":"pypi","package_name":"python-poetry","package_version":null,"solution":"If you're on poetry>=1.8, also make sure to have\n\n[tool.poetry]\npackage-mode = false\n\nin your configuration as stated here in the documentation here.\nOr when you're setting up a new project, simply run\n\npoetry install --no-root\n\nas mentioned by @bfontaine .\n\nOld solution:\n\nCheck if your pyproject.toml contains something like:\n\n[tool.poetry]\npackages = [{include = \"a_project\"}]\n\nRemoving the line with packages = [{include = \"a_project\"}] helped in my case and should avoid including the root project. See documentation here.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/75397736/poetry-install-on-an-existing-project-error-does-not-contain-any-element","votes":85,"created_at":"2026-04-19T04:52:24.092796+00:00","updated_at":"2026-04-19T04:52:24.092796+00:00"}