Open super-sk opened 5 years ago
Fixed here https://github.com/sphinx-contrib/sphinxcontrib-versioning/pull/69
But it seems CI-process is kind of broken.
The workaround is working, changing from sphinx import build_main
to from sphinx.cmd.build import build_main
. Should I close the issue right now ?
@super-sk I don't think so. My PR is still on code review stage, there are some issues with CI-process. Its will be better to keep issue opened
Any progress on this one?
@Eido95 waiting for merge here https://github.com/sphinx-contrib/sphinxcontrib-versioning/pull/78
is anyone still facing this issue in 2022? I am getting the same error.
Same issue here. I could need the fix as well
$ sphinx-build --version
sphinx-build 5.1.1
$ sphinx-versioning --version
Traceback (most recent call last):
File "C:\Users\manna\scoop\apps\python\current\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\manna\scoop\apps\python\current\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\manna\scoop\apps\python\current\Scripts\sphinx-versioning.exe\__main__.py", line 4, in <module>
File "C:\Users\manna\scoop\apps\python\current\lib\site-packages\sphinxcontrib\versioning\__main__.py", line 13, in <module>
from sphinxcontrib.versioning.routines import build_all, gather_git_info, pre_build, read_local_conf
File "C:\Users\manna\scoop\apps\python\current\lib\site-packages\sphinxcontrib\versioning\routines.py", line 11, in <module>
from sphinxcontrib.versioning.sphinx_ import build, read_config
File "C:\Users\manna\scoop\apps\python\current\lib\site-packages\sphinxcontrib\versioning\sphinx_.py", line 9, in <module>
from sphinx import application, build_main, locale
ImportError: cannot import name 'build_main' from 'sphinx' (C:\Users\manna\scoop\apps\python\current\lib\site-packages\sphinx\__init__.py)
For the time being I'll be using https://pypi.org/project/sphinx-multiversion/
Same issue here with
❯ sphinx-build --version
sphinx-build 5.0.2
and
❯ sphinx-versioning --version
Traceback (most recent call last):
File "/home/nik/.local/bin/sphinx-versioning", line 5, in <module>
from sphinxcontrib.versioning.__main__ import cli
File "/home/nik/.local/lib/python3.10/site-packages/sphinxcontrib/versioning/__main__.py", line 13, in <module>
from sphinxcontrib.versioning.routines import build_all, gather_git_info, pre_build, read_local_conf
File "/home/nik/.local/lib/python3.10/site-packages/sphinxcontrib/versioning/routines.py", line 11, in <module>
from sphinxcontrib.versioning.sphinx_ import build, read_config
File "/home/nik/.local/lib/python3.10/site-packages/sphinxcontrib/versioning/sphinx_.py", line 9, in <module>
from sphinx import application, build_main, locale
ImportError: cannot import name 'build_main' from 'sphinx' (/home/nik/.local/lib/python3.10/site-packages/sphinx/__init__.py)
same issue here:
$ sphinx-build --version
sphinx-build 5.3.0
Same issue here:
OS: Windows 10
python: 3.8.10
sphinx: 6.2.1
sphinxcontrib-versioning: 2.2.1
Using :
While running any
sphinxcontrib-versioning
command, I got :It seems like a wrong module call because
build_main
is not insphinx
package but it can be called from modulesphinx.cmd.build
.Indeed, when I manually modify as below :
everything seems to go well.