Error building documentation

33 views
Skip to first unread message

Linden Disney

unread,
Jun 9, 2025, 10:29:02 AMJun 9
to sage-support
Hello,

I have installed Sage following https://doc.sagemath.org/html/en/installation/conda.html#using-conda-to-provide-all-dependencies-for-the-sage-library and the process was successful, with all tests passing. Trying to build the documentation now gives me an error. 

Running "pip install --no-build-isolation -v -v --editable ./pkgs/sage-docbuild/" is successful (output pasted below for completeness), installing doc-build-10.7b2 in mamba (checked via "mamba list"). 

Running "sage --docbuild all html" fails saying 

"
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/localhome/home/pmtad/sage/src/sage_docbuild/__main__.py", line 82, in <module>
    from .builders import DocBuilder, ReferenceBuilder, get_builder, get_documents
  File "/localhome/home/pmtad/sage/src/sage_docbuild/builders.py", line 80, in <module>
    from . import build_options
  File "/localhome/home/pmtad/sage/src/sage_docbuild/build_options.py", line 12, in <module>
    LANGUAGES = [d for d in os.listdir(SAGE_DOC_SRC) if re.match('^[a-z][a-z]$', d)]
                            ^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/localhome/home/pmtad/miniforge3/envs/sage-dev/share/doc/sage'
"

I am using Sage version 10.7.beta2, Python 3.12.9, on Red Hat Enterprise Linux release 8.10. 

Cheers in advance for any help! 

Kind regards, Linden


Using pip 25.0.1 from /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages/pip (python 3.12)
Non-user install because site-packages writeable
Created temporary directory: /tmp/pip-build-tracker-ao4fc1_t
Initialized build tracking at /tmp/pip-build-tracker-ao4fc1_t
Created build tracker: /tmp/pip-build-tracker-ao4fc1_t
Entered build tracker: /tmp/pip-build-tracker-ao4fc1_t
Created temporary directory: /tmp/pip-install-jkquhszf
Created temporary directory: /tmp/pip-ephem-wheel-cache-jug0lz1h
Obtaining file:///localhome/home/pmtad/sage/pkgs/sage-docbuild
  Added file:///localhome/home/pmtad/sage/pkgs/sage-docbuild to build tracker '/tmp/pip-build-tracker-ao4fc1_t'
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Created temporary directory: /tmp/pip-modern-metadata-bgm7_f7a
  Running command Preparing editable metadata (pyproject.toml)
  running dist_info
  creating /tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info
  writing /tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info/requires.txt
  writing top-level names to /tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info/top_level.txt
  writing manifest file '/tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file '/tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild.egg-info/SOURCES.txt'
  creating '/tmp/pip-modern-metadata-bgm7_f7a/sage_docbuild-10.7b2.dist-info'
  Preparing editable metadata (pyproject.toml) ... done
  Source in ./pkgs/sage-docbuild has version 10.7b2, which satisfies requirement sage-docbuild==10.7b2 from file:///localhome/home/pmtad/sage/pkgs/sage-docbuild
  Removed sage-docbuild==10.7b2 from file:///localhome/home/pmtad/sage/pkgs/sage-docbuild from build tracker '/tmp/pip-build-tracker-ao4fc1_t'
Requirement already satisfied: sphinx in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sage-docbuild==10.7b2) (8.2.3)
Requirement already satisfied: sphinx-copybutton in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sage-docbuild==10.7b2) (0.5.2)
Requirement already satisfied: sphinxcontrib-applehelp>=1.0.7 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.0.0)
Requirement already satisfied: sphinxcontrib-devhelp>=1.0.6 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.0.0)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.6 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.1.0)
Requirement already satisfied: sphinxcontrib-jsmath>=1.0.1 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (1.0.1)
Requirement already satisfied: sphinxcontrib-qthelp>=1.0.6 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.0.0)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.9 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (1.1.10)
Requirement already satisfied: Jinja2>=3.1 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (3.1.6)
Requirement already satisfied: Pygments>=2.17 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.19.1)
Requirement already satisfied: docutils<0.22,>=0.20 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (0.21.2)
Requirement already satisfied: snowballstemmer>=2.2 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.2.0)
Requirement already satisfied: babel>=2.13 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.17.0)
Requirement already satisfied: alabaster>=0.7.14 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (1.0.0)
Requirement already satisfied: imagesize>=1.3 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (1.4.1)
Requirement already satisfied: requests>=2.30.0 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (2.32.3)
Requirement already satisfied: roman-numerals-py>=1.0.0 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (3.1.0)
Requirement already satisfied: packaging>=23.0 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from sphinx->sage-docbuild==10.7b2) (24.2)
Requirement already satisfied: MarkupSafe>=2.0 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from Jinja2>=3.1->sphinx->sage-docbuild==10.7b2) (3.0.2)
Requirement already satisfied: charset_normalizer<4,>=2 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->sage-docbuild==10.7b2) (3.4.1)
Requirement already satisfied: idna<4,>=2.5 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->sage-docbuild==10.7b2) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->sage-docbuild==10.7b2) (1.26.19)
Requirement already satisfied: certifi>=2017.4.17 in /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages (from requests>=2.30.0->sphinx->sage-docbuild==10.7b2) (2025.1.31)
Created temporary directory: /tmp/pip-unpack-ewr4_0yw
Building wheels for collected packages: sage-docbuild
  Created temporary directory: /tmp/pip-wheel-p7w877g8
  Destination directory: /tmp/pip-wheel-p7w877g8
  Running command Building editable for sage-docbuild (pyproject.toml)
  running editable_wheel
  creating /tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info
  writing /tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info/requires.txt
  writing top-level names to /tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info/top_level.txt
  writing manifest file '/tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file '/tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild.egg-info/SOURCES.txt'
  creating '/tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild-10.7b2.dist-info'
  creating /tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild-10.7b2.dist-info/WHEEL
  running build_py
  Editable install will be performed using a meta path finder.

  Options like `package-data`, `include/exclude-package-data` or
  `packages.find.exclude/include` may have no effect.

  adding '__editable___sage_docbuild_10_7b2_finder.py'
  adding '__editable__.sage_docbuild-10.7b2.pth'
  creating '/tmp/pip-wheel-p7w877g8/.tmp-6zs2uefq/sage_docbuild-10.7b2-0.editable-py3-none-any.whl' and adding '/tmp/tmpp2zgwwqisage_docbuild-10.7b2-0.editable-py3-none-any.whl' to it
  adding 'sage_docbuild-10.7b2.dist-info/METADATA'
  adding 'sage_docbuild-10.7b2.dist-info/WHEEL'
  adding 'sage_docbuild-10.7b2.dist-info/top_level.txt'
  adding 'sage_docbuild-10.7b2.dist-info/RECORD'
  /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages/setuptools/command/editable_wheel.py:342: InformationOnly: Editable installation.
  !!

          ********************************************************************************
          Please be careful with folders in your working directory with the same
          name as your package as they may take precedence during imports.
          ********************************************************************************

  !!
    with strategy, WheelFile(wheel_path, "w") as wheel_obj:
  Building editable for sage-docbuild (pyproject.toml) ... done
  Created wheel for sage-docbuild: filename=sage_docbuild-10.7b2-0.editable-py3-none-any.whl size=3537 sha256=4102daf7b51803b934cf1e2a00a950b1c87a0c2912a05c355ee3345f71b61173
  Stored in directory: /tmp/pip-ephem-wheel-cache-jug0lz1h/wheels/bd/a5/69/5180bcabf2b1c61832f4fedd3d598bca326dc8e2cb16485c0e
Successfully built sage-docbuild
Installing collected packages: sage-docbuild
  Attempting uninstall: sage-docbuild
    Found existing installation: sage-docbuild 10.7b2
    Uninstalling sage-docbuild-10.7b2:
      Created temporary directory: /tmp/pip-uninstall-vnctt74o
      Removing file or directory /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages/__editable__.sage_docbuild-10.7b2.pth
      Removing file or directory /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages/__editable___sage_docbuild_10_7b2_finder.py
      Removing file or directory /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages/__pycache__/__editable___sage_docbuild_10_7b2_finder.cpython-312.pyc
      Created temporary directory: /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages/~age_docbuild-10.7b2.dist-info
      Removing file or directory /localhome/home/pmtad/miniforge3/envs/sage-dev/lib/python3.12/site-packages/sage_docbuild-10.7b2.dist-info/
      Successfully uninstalled sage-docbuild-10.7b2

Successfully installed sage-docbuild-10.7b2
Remote version of pip: 25.1.1
Local version of pip:  25.0.1
Was pip installed by pip? False
Removed build tracker: '/tmp/pip-build-tracker-ao4fc1_t'





Vincent Delecroix

unread,
Jun 9, 2025, 3:16:14 PMJun 9
to sage-s...@googlegroups.com
Dear Linden,

The error is kind of strange

> File "/localhome/home/pmtad/sage/src/sage_docbuild/build_options.py", line 12, in <module>
> LANGUAGES = [d for d in os.listdir(SAGE_DOC_SRC) if re.match('^[a-z][a-z]$', d)]
> ^^^^^^^^^^^^^^^^^^^^^^^^
> FileNotFoundError: [Errno 2] No such file or directory: '/localhome/home/pmtad/miniforge3/envs/sage-dev/share/doc/sage'

It seems that you prior to your compilation you installed sage in your
miniforge environment. The latter seems to interfere with the source
code. Can you reproduce the weird behavior by

1) starting the sage console that you just built
2) post the outputs of the following commands

sage: import os.path
sage: from sage.env import SAGE_DOC
sage: print(SAGE_DOC)
sage: os.path.isdir(SAGE_DOC)

One work around is to uninstall sagelib from your miniforge environment.

Vincent
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/sage-support/8d1ab2af-4295-4012-9157-6d71fa6f2a59n%40googlegroups.com.

Linden Disney

unread,
Jun 10, 2025, 4:25:32 AMJun 10
to sage-support
Dear Vincent,

Running the code you suggest gives

"
sage: import os.path
sage: from sage.env import SAGE_DOC
sage: print(SAGE_DOC)
/localhome/home/pmtad/miniforge3/envs/sage-dev/share/doc/sage
sage: os.path.isdir(SAGE_DOC)
False
"

I don't think this miniforge environment does have Sage installed independently, I really just set it up using the environment-3.12-linux.yml, I cannot see any other Sage packages when looking at the sage-dev environment, and trying "mamba remove sagelib" gives 

"
Transaction

  Prefix: /localhome/home/pmtad/miniforge3/envs/sage-dev

  Failure: packages to remove not found in the environment:

  - sagelib


Transaction starting

Transaction finished
"

I recall having a version of Sage built from source via a different mechanism a while ago, so perhaps that has broken some links? 
Reply all
Reply to author
Forward
0 new messages