[Python] KeyError: 'Name' in pipenv/vendor/importlib_metadata/_adapters.py:54 using pipenv

Discussão em 'Python' iniciado por Stack, Setembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    I got this weird error in my CI/CD pipeline running in GCP Cloud build.


    Package installation failed... KeyError: 'Name' site-packages/pipenv/vendor/importlib_metadata/_adapters.py:54 everything is working locally when runnning pipenv install.
    ​

    I'm running in python 3.11.4.

    Troubleshooting steps that I have followed are:

    • Remove the Pipfile.lock entirely and run again pipenv install didn't work.
    • Removed the environment entirely pipenv --rm and removed the cache pip cache purge then recreate again the env pipenv shell && pipenv install didn't solved the issue.
    Still more on it:

    • I found this thread: https://github.com/pypa/twine/issues/1125#issuecomment-2191295673 where the issue is identified as caused by a breaking change in importlib_metadata==8.0.0 and that the way of solving it is just pin the version importlib-metadata==7.2.1 so I went ahead and applied the change but unfortunately it didn't solved the issue.
    • I ran as well pipenv graph | grep "importlib" and all the dependencies for importlib are pointing to that 7.2.1 version.

    Continue reading...

Compartilhe esta Página