## 事象 [[uv]]を使って `make html` コマンドを実行する。 ```console $ uv run make html sphinx-build -b html -d _build/doctrees . _build/html Running Sphinx v5.3.0 ``` 以下のエラーになる。 ```error Extension error: Could not import extension sphinx.builders.epub3 (exception: No module named 'imghdr') make: *** [Makefile:55: html] Error 2 ``` - [[Sphinx]]のバージョンは5.3.0 - [[uv]]のバージョンは0.5.14 - [[Python]]のバージョンは3.13.1 ## 原因 [[imghdr]]が[[Python 3.13]]で削除されたから。 <div class="link-card"> <div class="link-card-header"> <img src="https://docs.python.org/ja/3.13/_static/py.svg" class="link-card-site-icon"/> <span class="link-card-site-name">Python documentation</span> </div> <div class="link-card-body"> <div class="link-card-content"> <p class="link-card-title">imghdr --- Determine the type of an image</p> <p class="link-card-description">This module is no longer part of the Python standard library. It was removed in Python 3.13 after being deprecated in Python 3.11. The removal was decided in PEP 594. P ... </p> </div> <img src="https://docs.python.org/3/_static/og-image.png" class="link-card-image" /> </div> <a href="https://docs.python.org/ja/3.13/library/imghdr.html"></a> </div> ## 解決方法 [[Sphinx]]バージョンを上げる。8系にすると[[Python 3.9]]がサポートされないので、その場合は7系にする。 ```toml dev = [ "sphinx<8.0,>=7", ] ```