Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyterbook not building with sphinxcontrib-bibtex failure #1137

Closed
Rahuketu86 opened this issue Dec 13, 2020 · 10 comments · Fixed by #1754
Closed

Jupyterbook not building with sphinxcontrib-bibtex failure #1137

Rahuketu86 opened this issue Dec 13, 2020 · 10 comments · Fixed by #1754
Labels
state: upstream Requires a change to a dependant package

Comments

@Rahuketu86
Copy link

I am unable to build a jupyter book with following error /home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/sphinxcontrib/bibtex/init.py

Steps taken :

  1. Created a new conda environment
  2. pip install -r requirements.txt

My requirements.txt

jupyter
jupyter-book
pyreadline
plotly
plotly-express
plotnine
ipympl
altair
vega_datasets
bqplot
seaborn
  1. jb create tbook
  2. jb build tbook
  3. (Others) Tried adding bibtex_bibfiles in _config.yml with no success

(testjb) ubuntu@ip-10-134-194-166:/Landmark2/pdo/Code/ALDAOps/metis$ jb create tbook

===============================================================================

Your book template can be found at

tbook/

===============================================================================

(testjb) ubuntu@ip-10-134-194-166:/Landmark2/pdo/Code/ALDAOps/metis$ jb build tbook
Running Jupyter-Book v0.8.3
Source Folder: /Landmark2/pdo/Code/ALDAOps/metis/tbook
Config Path: /Landmark2/pdo/Code/ALDAOps/metis/tbook/_config.yml
Output Path: /Landmark2/pdo/Code/ALDAOps/metis/tbook/_build/html
Running Sphinx v3.3.1
making output directory... done
myst v0.12.10: MdParserConfig(renderer='sphinx', commonmark_only=False, dmath_enable=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, amsmath_enable=False, deflist_enable=False, update_mathjax=True, admonition_enable=False, figure_enable=False, disable_syntax=[], html_img_enable=False, url_schemes=['mailto', 'http', 'https'], heading_anchors=None)

Extension error:
You must configure the bibtex_bibfiles setting
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/jupyter_book/sphinx.py", line 110, in build_sphinx
app = Sphinx(
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/sphinx/application.py", line 278, in init
self._init_builder()
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/sphinx/application.py", line 337, in _init_builder
self.events.emit('builder-inited')
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/sphinx/events.py", line 110, in emit
results.append(listener.handler(self.app, *args))
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/sphinxcontrib/bibtex/init.py", line 45, in init_bibtex_cache
raise ExtensionError("You must configure the bibtex_bibfiles setting")
sphinx.errors.ExtensionError: You must configure the bibtex_bibfiles setting

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/testjb/bin/jb", line 8, in
sys.exit(main())
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/jupyter_book/commands/init.py", line 259, in build
builder_specific_actions(
File "/home/ubuntu/anaconda3/envs/testjb/lib/python3.9/site-packages/jupyter_book/commands/init.py", line 500, in builder_specific_actions
raise RuntimeError(_message_box(msg, color="red", doprint=False)) from result
RuntimeError:

There was an error in building your book. Look above for the cause.

===============================================================================

(testjb) ubuntu@ip-10-134-194-166:/Landmark2/pdo/Code/ALDAOps/metis$

@spring-haru
Copy link

I encountered the same problem in running Github Actions to build my site today, though versions are different.

Running Jupyter-Book v0.8.3
7
Source Folder: /home/runner/work/py4etrics.github.io/py4etrics.github.io
8
Config Path: /home/runner/work/py4etrics.github.io/py4etrics.github.io/_config.yml
9
Output Path: /home/runner/work/py4etrics.github.io/py4etrics.github.io/_build/html
10
Running Sphinx v3.3.1
11
myst v0.12.10: MdParserConfig(renderer='sphinx', commonmark_only=False, dmath_enable=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, amsmath_enable=False, deflist_enable=False, update_mathjax=True, admonition_enable=False, figure_enable=False, disable_syntax=[], html_img_enable=False, url_schemes=['mailto', 'http', 'https'], heading_anchors=None)
12

13
Extension error:
14
You must configure the bibtex_bibfiles setting
15
Traceback (most recent call last):
16
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/jupyter_book/sphinx.py", line 124, in build_sphinx
17
    keep_going=keep_going,
18
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/sphinx/application.py", line 278, in __init__
19
    self._init_builder()
20
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/sphinx/application.py", line 337, in _init_builder
21
    self.events.emit('builder-inited')
22
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/sphinx/events.py", line 110, in emit
23
    results.append(listener.handler(self.app, *args))
24
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/sphinxcontrib/bibtex/__init__.py", line 45, in init_bibtex_cache
25
    raise ExtensionError("You must configure the bibtex_bibfiles setting")
26
sphinx.errors.ExtensionError: You must configure the bibtex_bibfiles setting
27

28
The above exception was the direct cause of the following exception:
29

30
Traceback (most recent call last):
31
  File "/opt/hostedtoolcache/Python/3.7.9/x64/bin/jupyter-book", line 8, in <module>
32
    sys.exit(main())
33
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/click/core.py", line 829, in __call__
34
    return self.main(*args, **kwargs)
35
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/click/core.py", line 782, in main
36
    rv = self.invoke(ctx)
37
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
38
    return _process_result(sub_ctx.command.invoke(sub_ctx))
39
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
40
    return ctx.invoke(self.callback, **ctx.params)
41
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/click/core.py", line 610, in invoke
42
    return callback(*args, **kwargs)
43
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/jupyter_book/commands/__init__.py", line 260, in build
44
    result, builder, OUTPUT_PATH, build_type, PAGE_NAME, click.echo
45
  File "/opt/hostedtoolcache/Python/3.7.9/x64/lib/python3.7/site-packages/jupyter_book/commands/__init__.py", line 500, in builder_specific_actions
46
    raise RuntimeError(_message_box(msg, color="red", doprint=False)) from result
47
RuntimeError: 
48
===============================================================================
49

50
There was an error in building your book. Look above for the cause.
51

52
===============================================================================
53

54
Error: Process completed with exit code 1.

@partmor
Copy link

partmor commented Dec 13, 2020

Same as @spring-haru here:

I got the ExtensionError("You must configure the bibtex_bibfiles setting") in gh-actions, using ubuntu-latest and Python 3.7.9.

@choldgraf
Copy link
Collaborator

Argg - this is because sphinx-bibtex just released a major version that's incompatible. I've pinned sphinxcontrib-bibtex to the 1.0 version on the master branch, and we'll get that into the next JB release. In the meantime just ensure that you have sphinxcontrib-bibtex 1.0 👍

@partmor
Copy link

partmor commented Dec 13, 2020

Argg - this is because sphinx-bibtex just released a major version that's incompatible. I've pinned sphinxcontrib-bibtex to the 1.0 version on the master branch, and we'll get that into the next JB release. In the meantime just ensure that you have sphinxcontrib-bibtex 1.0 👍

@choldgraf correct! I've just tried it, the sphinxcontrib-bibtex version 1.0 works, 2.0 doesn't (this is installed by default).

For the rest of people in the thread:

just add sphinxcontrib-bibtex==1.0.0 in your requirements.txt

Edit: sphinxcontrib-bibtex<2.0.0 probably more correct

@SimonBiggs
Copy link

just add sphinxcontrib-bibtex==1.0.0 in your requirements.txt

And for those of us using something like poetry, the following is key:

sphinxcontrib-bibtex = {version = "<2.0.0"} 

MaxGhenis added a commit to MaxGhenis/child-allowance that referenced this issue Dec 14, 2020
loikein added a commit to OpenSourceEconomics/econsa that referenced this issue Dec 14, 2020
d70-t added a commit to d70-t/how_to_eurec4a that referenced this issue Dec 14, 2020
The root cause of previous build failures seems to be related to an
incompatible upgrade of the `sphinxcontrib-bibtex` package as also noted
in jupyter-book/jupyter-book#1137. This pin can most likely be
removed once a new version of `jupyter-book` is available, either
because `jupyter-book` includes the pin in its dependencies or because it
adapts to the new requirements of `sphinxcontrib-bibtex`.

I've also removed the tag for the gitlab runner as it is very likely
that it was working on the one runner and not on the other because it
cached an older version of `sphinxcontrib-bibtex` and as soon as the
cache would be emptied the issue might arise again.
xldrkp added a commit to annalaine/quaxp that referenced this issue Dec 14, 2020
@g4brielvs
Copy link

g4brielvs commented Dec 14, 2020

I am having the same issue. Adding sphinxcontrib-bibtex<2.0.0 to requirements.txt should fix it for the moment.

@Rahuketu86
Copy link
Author

Rahuketu86 commented Dec 14, 2020

Thank you for quick resolution. It seems to be working with pinning to version 1.0.0

alissa-huskey added a commit to alissa-huskey/python-class that referenced this issue Dec 15, 2020
Fix jupyter-book build by pinning sphinxcontrib-bibtex version to < 2.0
per jupyter-book/jupyter-book#1137.
alissa-huskey pushed a commit to alissa-huskey/python-class that referenced this issue Dec 15, 2020
Fix jupyter-book build by pinning sphinxcontrib-bibtex version to < 2.0
per jupyter-book/jupyter-book#1137. 81c9255
sanjayankur31 added a commit to NeuroML/Documentation that referenced this issue Dec 16, 2020
The new major release brings changes that break jupyter-book.

Reference:
jupyter-book/jupyter-book#1137
@atantet
Copy link

atantet commented Dec 19, 2020

I'm new to Jupyter Book, but maybe an entry could be added to the FAQ for new users who encounter this problem ? A simple quick and dirty fix without having to handle versions with pip is to add

sphinx:
  config:
    bibtex_bibfiles: "your_reference_file.bib"

in the _config.yml file.

daffidwilde added a commit to daffidwilde/edo that referenced this issue Jan 20, 2021
Mathnerd314 added a commit to Mathnerd314/stroscot that referenced this issue Jan 30, 2021
koldunovn added a commit to FESOM/fesom2_doc that referenced this issue Feb 10, 2021
FanwangM added a commit to FanwangM/procrustes that referenced this issue Mar 4, 2021
This error is caused by sphinx-bibtex major 2.0.0 release which
is incompatible. Using version 1.0.0 can fix this.
For more information, https:
//github.com/jupyter-book/jupyter-book/issues/1137
@arnavs
Copy link

arnavs commented Apr 19, 2021

I'm new to Jupyter Book, but maybe an entry could be added to the FAQ for new users who encounter this problem ? A simple quick and dirty fix without having to handle versions with pip is to add

sphinx:
  config:
    bibtex_bibfiles: "your_reference_file.bib"

in the _config.yml file.

I second this.

@scottyhq
Copy link

just came across this and crawled open issues for a bit trying to figure things out.

it wasn't clear that the current (jbook 0.10.2) documented citations syntax requires sphinxcontrib-bibtex>2.0.0 https://jupyterbook.org/content/citations.html?highlight=citations#change-the-in-line-citation-style

if you're installing jupyterbook from conda-forge it will pull sphinxcontrib-bibtex<2 until conda-forge/sphinxcontrib-bibtex-feedstock#16 is merged.

My current workaround is to pip install sphinxcontrib-bibtex==2.2.0 and then have the following in _config.yml:

# Bibliography
bibtex_bibfiles:
  - references.bib
sphinx:
  config:
    bibtex_reference_style: author_year  # or label, super, \supercite

jeongyoonlee added a commit to uber/causalml that referenced this issue May 18, 2021
Sphinx doc generation has been failing because of latest updates from `sphinxcontrib-bibtex`. Pinning it `<2.0.0` to fix it.
ref: jupyter-book/jupyter-book#1137 (comment)
jeongyoonlee added a commit to uber/causalml that referenced this issue May 18, 2021
Sphinx doc generation has been failing because of latest updates from `sphinxcontrib-bibtex`. Pinning it `<2.0.0` to fix it.

ref: jupyter-book/jupyter-book#1137 (comment)
mmann1123 added a commit to mmann1123/jupyter-book that referenced this issue Jun 15, 2022
aauss added a commit to JarnoRFB/epysurv that referenced this issue Jun 14, 2023
Major version in sphinx-bibtex is incompatible with this library's
sphinx version. This commit restricts the version number:
jupyter-book/jupyter-book#1137 (comment)

The latest release of jinja2 introduces was not compatible with
this library's sphinx version. This commit restricts the version number:
readthedocs/readthedocs.org#9038 (comment)

isort is used in pre-commit hook but does not come with the
requirements-dev.txt. This commit adds it to have it available during
development.

Building the docs with a Jupyter notebook in it requires pandoc. The
README is updated to include an installation instruction. Using
conda is suggested in this stackoverflow question:
https://stackoverflow.com/questions/62398231/building-docs-fails-due-to-missing-pandoc
Utsuro1 added a commit to Utsuro1/causalml that referenced this issue Jul 22, 2024
Sphinx doc generation has been failing because of latest updates from `sphinxcontrib-bibtex`. Pinning it `<2.0.0` to fix it.

ref: jupyter-book/jupyter-book#1137 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: upstream Requires a change to a dependant package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants