Reputation: 1743
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:
Pipfile.lock
entirely and run again pipenv install
didn't work.pipenv --rm
and removed the cache pip cache purge
then recreate again the env pipenv shell && pipenv install
didn't solved the issue.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.pipenv graph | grep "importlib"
and all the dependencies for importlib are pointing to that 7.2.1
version.Upvotes: 2
Views: 229
Reputation: 1743
After running and validating that the build was working properly in docker by using:
docker buildx build --platform linux/arm64 -t fakename -f Dockerfile .
I found that pipenv
was resolving the dependencies correctly by building the image properly all along the way. Then I found that I had this setting in kaniko
:
--cache=true
Then I disabled it by setting --cache=false
and it worked and solved the issue, this will slow down the builds unfortunately but I had no options for now.
cache
entirely and instead use cache-ttl
:--cache=true
--cache-ttl=24h
And it worked the first time but after a while maybe 2 hours later it lead me to the same issue so I rolled back the changes unfortunately.
--cache-repo
setting and this give me the following combination:--cache=true
--cache-ttl=24h
--cache-repo=myrepo
Maybe that will avoid other cache repos to overwrite my dependencies' cached in this repo and will give me the granularity that I need for the cache(I have not tested this yet).
Upvotes: 0