isort — How to Fix RuntimeError: The Poetry configuration is invalid

<p>If your pre-commit hooks are failing due to a&nbsp;<code>poetry</code>&nbsp;and&nbsp;<code>isort</code>&nbsp;issue, you are not alone. Over the last few days, people have started complaining about an error in their pre-commit hooks when attemtping to install&nbsp;<code>isort</code>&nbsp;via&nbsp;<code>poetry</code>:</p> <pre> [INFO] Installing environment for https://github.com/pycqa/isort. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... An unexpected error has occurred: CalledProcessError: command: (&#39;/builds/.../.cache/pre-commit/repo0_h0f938/py_env-python3.8/bin/python&#39;, &#39;-mpip&#39;, &#39;install&#39;, &#39;.&#39;) return code: 1 expected return code: 0 [...] stderr: ERROR: Command errored out with exit status 1: [...] File &quot;/tmp/pip-build-env-_3j1398p/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py&quot;, line 40, in prepare_metadata_for_build_wheel poetry = Factory().create_poetry(Path(&quot;.&quot;).resolve(), with_groups=False) File &quot;/tmp/pip-build-env-_3j1398p/overlay/lib/python3.8/site-packages/poetry/core/factory.py&quot;, line 57, in create_poetry raise RuntimeError(&quot;The Poetry configuration is invalid:\n&quot; + message) RuntimeError: The Poetry configuration is invalid: - [extras.pipfile_deprecated_finder.2] &#39;pip-shims&lt;=0.3.4&#39; does not match &#39;^[a-zA-Z-_.0-9]+$&#39;</pre> <p>This issue seems to have been caused due to a new poetry release. In this article, we&rsquo;ll dive into the details of the error in order to understand its trigger. Additionally, we&rsquo;ll also provide a couple of quick fixes you can apply in order to bring your poetry environments and pre-commit hooks back to life!</p> <p><a href="https://levelup.gitconnected.com/fix-runtimeerror-poetry-isort-5db7c67b60ff">Read More</a></p>