Dirk's Tech Findings

Python pip: Constantly failing with "Import Error"

Publication date: 2019-11-19

Issue: pip failing with "Import Error" on an Alpine container after using a recent salt-ssh

pip no longer working on an Alpine container after using a recent salt-ssh: "ImportError: cannot import name 'SourceDistribution' from 'pip._internal.distributions.source'"

Solution: Recreate container or reinstall pip

The cleanest solution is to recreate the container completely using the automation.

The only alternative I found is to repairs pip3 in the existing container the following way:

wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py

However, I would consider that just a workaround.

Back to topic list...