最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - MongoDBdocs: cannot generate HTML documentation - Stack Overflow

programmeradmin2浏览0评论

I would like to install MongoDB manual, in HTML format, on a standalone computer. This computer is disconnected from the internet.

The MongoDB/docs project on GitHub, , offers a solution but I cannot get it to work. The project's README says:

python2 -m pip install giza
git clone .git
cd docs/
make html

I tried installing the most recent version of giza, v0.5.18, circa 2019, in a Python 3.10 virtual environment. When I execute make html, giza throws the error sphinx.make_mode module not found:

Traceback (most recent call last):
  File "/home/ezhik/pyenvs/py3-giza/bin/giza", line 5, in <module>
    from giza.cmdline import main
  File "/home/ezhik/pyenvs/py3-giza/lib/python3.10/site-packages/giza/cmdline.py", line 19, in <module>
    from giza.config.runtime import RuntimeStateConfig
  File "/home/ezhik/pyenvs/py3-giza/lib/python3.10/site-packages/giza/config/runtime.py", line 25, in <module>
    from giza.config.sphinx_config import available_sphinx_builders
  File "/home/ezhik/pyenvs/py3-giza/lib/python3.10/site-packages/giza/config/sphinx_config.py", line 20, in <module>
    import sphinx.make_mode
ModuleNotFoundError: No module named 'sphinx.make_mode'

I tried installing giza, v0.5.18, in a Python 2.7 virtual environment but I get the error cannot meet requirements:

ERROR: Could not find a version that satisfies the requirement Pygments>=2.12.0 (from jsx-lexer->giza) (from versions: 0.5, 0.5.1, 0.6, 0.7, 0.7.1, 0.8, 0.8.1, 0.9, 0.10, 0.11, 0.11.1, 1.0, 1.1, 1.1.1, 1.2, 1.2.1, 1.2.2, 1.3, 1.3.1, 1.4, 1.5, 1.6rc1, 1.6, 2.0rc1, 2.0, 2.0.1, 2.0.2, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.4.2, 2.5.1, 2.5.2)
ERROR: No matching distribution found for Pygments>=2.12.0 (from jsx-lexer->giza)

What is the best path forward? Does it make sense to install previous versions of giza in Python 2.7 and hope the dependency issues will go away?

I would like to install MongoDB manual, in HTML format, on a standalone computer. This computer is disconnected from the internet.

The MongoDB/docs project on GitHub, https://github/mongodb/docs, offers a solution but I cannot get it to work. The project's README says:

python2 -m pip install giza
git clone https://github/mongodb/docs.git
cd docs/
make html

I tried installing the most recent version of giza, v0.5.18, circa 2019, in a Python 3.10 virtual environment. When I execute make html, giza throws the error sphinx.make_mode module not found:

Traceback (most recent call last):
  File "/home/ezhik/pyenvs/py3-giza/bin/giza", line 5, in <module>
    from giza.cmdline import main
  File "/home/ezhik/pyenvs/py3-giza/lib/python3.10/site-packages/giza/cmdline.py", line 19, in <module>
    from giza.config.runtime import RuntimeStateConfig
  File "/home/ezhik/pyenvs/py3-giza/lib/python3.10/site-packages/giza/config/runtime.py", line 25, in <module>
    from giza.config.sphinx_config import available_sphinx_builders
  File "/home/ezhik/pyenvs/py3-giza/lib/python3.10/site-packages/giza/config/sphinx_config.py", line 20, in <module>
    import sphinx.make_mode
ModuleNotFoundError: No module named 'sphinx.make_mode'

I tried installing giza, v0.5.18, in a Python 2.7 virtual environment but I get the error cannot meet requirements:

ERROR: Could not find a version that satisfies the requirement Pygments>=2.12.0 (from jsx-lexer->giza) (from versions: 0.5, 0.5.1, 0.6, 0.7, 0.7.1, 0.8, 0.8.1, 0.9, 0.10, 0.11, 0.11.1, 1.0, 1.1, 1.1.1, 1.2, 1.2.1, 1.2.2, 1.3, 1.3.1, 1.4, 1.5, 1.6rc1, 1.6, 2.0rc1, 2.0, 2.0.1, 2.0.2, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.4.2, 2.5.1, 2.5.2)
ERROR: No matching distribution found for Pygments>=2.12.0 (from jsx-lexer->giza)

What is the best path forward? Does it make sense to install previous versions of giza in Python 2.7 and hope the dependency issues will go away?

Share Improve this question asked Feb 14 at 17:37 user3830744user3830744 1511 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

It turns out this question has been asked and answered before:

  1. How to build MongoDB documentation locally?
  2. https://www.mongodb/community/forums/t/how-to-build-mongodb-documentation-locally/152658
  3. https://www.mongodb/docs/meta/tutorials/install/

I found the reference (1) easiest to follow.

I could not install giza, subject to the requirements file in (1), with Python 3. The install succeeded with Python 2.7 even though there was a warning message about incompatibility between requests package (2.22.0) and urllib3 (1.26.5) package.

With giza installed, run make html twice. The first run displays few errors and fails:

ERROR:giza.pool:caught error "'ascii' codec can't encode character u'\xe1' in position 2397:
ERROR:giza.content.intersphinx:Error downloading https://api.mongodb/python/current/objects.inv: Got 404
ERROR:giza.pool:[UnicodeEncodeError('ascii', u'To use an index for string comparisons, ...

The second run suceeds after displaying many warning messages about missing options or undefined labels:

source/reference/log-messages.txt:775: WARNING: undefined label: storage-wiredtiger (if the link has no caption the label must precede a section header)
source/includes/steps/kerberos-auth-activedirectory-authz.rst:1108: WARNING: unknown option: mongosh --username

After the second run, HTML documentation is in build/master/html. Beware that "local" manual is not entirely local. It contains many links to outside resources, for example, DRIVERS and GUIDES, all point to mongodb.

发布评论

评论列表(0)

  1. 暂无评论