Skip to content

bug(doc): local mkdocs build issue #1908

Open
@LouisTsai-Csie

Description

@LouisTsai-Csie

Summary

I could not build the documentation locally with mkdoc.

Environment: MacOS (M2 chip)

Reproduction

I follow the documentation to build:

  1. uv sync --all-extras
  2. uv run mkdocs build --strict or uv 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:

  1. brew install cairo / brew reinstall cairo
  2. unistall and install cairosvg again
  3. 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:docsScope: Documentationtype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions