"Symbol not found: __dyld_shared_cache_contains_path" on OSX after installl from backup?

Viewed 265

I've just got a new Macbook running OSX 10.15.7. I installed it from a Time Machine backup of my old machine.

Now when I try to import the ctypes library in Python:

python -c "import ctypes"

I see this:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: dlopen(/usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so, 2): Symbol not found: __dyld_shared_cache_contains_path
  Referenced from: /usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so (which was built for Mac OS X 11.0)
  Expected in: /usr/lib/libSystem.B.dylib
 in /usr/local/Cellar/python@3.9/3.9.1_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_ctypes.cpython-39-darwin.so

I have no idea how to debug this - can anyone advise? It means I can't run Jupyter notebooks, among other things.

0 Answers
Related