November 23, 2019
A few times now, I've had to get around an issue that happens on macOS Catalina where you try to run a Python script and it fails with an import error:
ImportError: No module named zlib
The stacktrace will differ based on what was trying to import zlib, but the fix for me (on the most recent Catalina builds) was to reinstall python2 or python3 via brew. As some others have noted, it's important to
xcode-select --install first, if you haven't.
If the script is Python 2:
brew reinstall python2
If the script is Python 3:
brew reinstall python3
I'm Noah, a software developer based in the San Francisco Bay Area. I focus mainly on iOS, Apple platform development, and full stack web development.
Hello! I'm Noah, a software developer based in the San Francisco bay area. I focus mainly on iOS, Apple platform development, and full stack web development.