ModuleNotFoundError: No module named 'flit_core' on macOS Catalina 10.15

I run certbot on a Mac mini set up as a server that is stuck on macOS Catalina, to run a small internal website. Certbot is installed via Homebrew to provide that website with a certificate. Right now the Mac has certbot 2.6.0, but brew is trying to upgrade it to 2.7.1. This is failing apparently due to flit_core not being found. The relevant output from brew upgrade certbot is:

==> Upgrading certbot
  2.6.0_1 -> 2.7.1 

==> Installing dependencies for certbot: python-typing-extensions, python-cryptography and python-pyparsing
==> Installing certbot dependency: python-typing-extensions
==> /usr/local/opt/python@3.10/libexec/bin/pip install .
==> /usr/local/opt/python@3.11/libexec/bin/pip install .
==> /usr/local/opt/python@3.12/libexec/bin/pip install .
Last 15 lines from /Users/apple/Library/Logs/Homebrew/python-typing-extensions/03.pip:
  File "/usr/local/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1304, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1318, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'flit_core'

Any ideas how to fix this? I've tried reinstalling, relinking, and whatnot the various packages in brew to no avail. I do notice that the current certbot formulae indicates a dependency on Python 3.11, which does seem to get through the pip install step, so I also kinda wonder why my installation is even trying with Python 3.12 at all, too.

I can't simply install certbot on my main Mac and copy it over, because the server Mac mini is Intel, and my main Mac is Apple Silicon. But would that sort of thing generally work if it weren't for the architecture mismatch? Is there some other place I can download a pre-built binary of certbot to install on the server without it needing all the dependencies for building?

Any help or advice is greatly appreciated, although I also assume version 2.6.0 will work for a while anyway, so I doubt that this is an urgent matter.

1 Like

Oddly enough, I tried brew install -v certbot to use verbose mode, figuring I may get a more helpful error message, but instead it just worked. Who knows why.

1 Like

Which certbot version is it now?

2 Likes

certbot 2.7.2

1 Like

Perfect!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.