macos python running md2pdf, weasyprint reports error cannot load library 'libgobject-2.0-0'

Error Report

When running md2pdf with Python to convert markdown and WeasyPrint to PDF, it prompts that libgobject-2.0-0 cannot be found

OSError: cannot load library 'libgobject-2.0-0': dlopen(libgobject-2.0-0, 0x0002): tried: 'libgobject-2.0-0' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibgobject-2.0-0' (no such file), '/usr/lib/libgobject-2.0-0' (no such file, not in dyld cache), 'libgobject-2.0-0' (no such file).  
Additionally, ctypes.util.find_library() did not manage to locate a library called 'libgobject-2.0-0'  

Although pandoc, pango, libffi, and other packages have been installed via homebrew, it still didn’t work

Eventually, by creating symbolic links, the related dependencies installed by homebrew were linked to the local directory

sudo ln -s /opt/homebrew/lib/libgobject-2.0.0.dylib /usr/local/lib/libgobject-2.0-0  
sudo ln -s /opt/homebrew/lib/libpango-1.0.0.dylib /usr/local/lib/libpango-1.0-0  
sudo ln -s /opt/homebrew/lib/libharfbuzz.0.dylib /usr/local/lib/libharfbuzz-0  
sudo ln -s /opt/homebrew/lib/libfontconfig.1.dylib /usr/local/lib/libfontconfig-1  
sudo ln -s /opt/homebrew/lib/libpangoft2-1.0.dylib /usr/local/lib/libpangoft2-1.0-0  

References