Open
Description
Summary
I could not build the documentation locally with mkdoc
.
Environment: MacOS (M2 chip)
Reproduction
I follow the documentation to build:
uv sync --all-extras
uv run mkdocs build --strict
oruv run mkdocs serve
I will get the following output in terminal
(ethereum-execution-spec-tests) caijiacheng@caijiachengs-MacBook-Air execution-spec-tests % uv run mkdocs build --strict
ERROR - "cairosvg" Python module is installed, but it crashed with:
no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': dlopen(libcairo.so.2, 0x0002): tried: 'libcairo.so.2' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibcairo.so.2' (no such
file), '/usr/lib/libcairo.so.2' (no such file, not in dyld cache), 'libcairo.so.2' (no such file). Additionally, ctypes.util.find_library() did not manage to locate a
library called 'libcairo.so.2'
cannot load library 'libcairo.2.dylib': dlopen(libcairo.2.dylib, 0x0002): tried: 'libcairo.2.dylib' (no such file),
'/System/Volumes/Preboot/Cryptexes/OSlibcairo.2.dylib' (no such file), '/usr/lib/libcairo.2.dylib' (no such file, not in dyld cache), 'libcairo.2.dylib' (no such
file). Additionally, ctypes.util.find_library() did not manage to locate a library called 'libcairo.2.dylib'
cannot load library 'libcairo-2.dll': dlopen(libcairo-2.dll, 0x0002): tried: 'libcairo-2.dll' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibcairo-2.dll' (no
such file), '/usr/lib/libcairo-2.dll' (no such file, not in dyld cache), 'libcairo-2.dll' (no such file). Additionally, ctypes.util.find_library() did not manage to
locate a library called 'libcairo-2.dll'
--> Check out the troubleshooting guide: https://t.ly/MfX6u
Aborted with a BuildError!
After consulting online resource and LLM, I've tried the following steps:
brew install cairo
/brew reinstall cairo
- unistall and install
cairosvg
again - Export the library path for macOS dynamic linker:
export DYLD_LIBRARY_PATH="/opt/homebrew/lib:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"