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

BUG: "Spinx parallel build error" when running python make.py html #53777

Closed
3 tasks done
tpaxman opened this issue Jun 21, 2023 · 5 comments · Fixed by #53788
Closed
3 tasks done

BUG: "Spinx parallel build error" when running python make.py html #53777

tpaxman opened this issue Jun 21, 2023 · 5 comments · Fixed by #53788
Labels
Docs Needs Info Clarification about behavior needed to assess issue Warnings Warnings that appear or should be added to pandas

Comments

@tpaxman
Copy link
Contributor

tpaxman commented Jun 21, 2023

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

after setting up the pandas-dev environment and building pandas as described in the instructions, and changing to doc/ directory run these commands:

python make.py clean
python make.py html

Issue Description

Getting this error:

Sphinx parallel build error:
RuntimeError: Non Expected warning in `/home/tpaxman/code/pandas-tpaxman/doc/source/getting_started/intro_tutorials/04_plotting.rst` line 70

I believe there was a similar error occurring previously that was fixed with #53726 but seems that the error is happening again.

Expected Behavior

No error

Installed Versions

INSTALLED VERSIONS

commit : bd9a671
python : 3.10.11.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.90.1-microsoft-standard-WSL2
Version : #1 SMP Fri Jan 27 02:56:13 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8

pandas : 2.1.0.dev0+1018.gbd9a67131a
numpy : 1.24.3
pytz : 2023.3
dateutil : 2.8.2
setuptools : 67.7.2
pip : 23.1.2
Cython : 0.29.33
pytest : 7.3.2
hypothesis : 6.79.1
sphinx : 6.2.1
blosc : None
feather : None
xlsxwriter : 3.1.2
lxml.etree : 4.9.2
html5lib : 1.1
pymysql : 1.0.3
psycopg2 : 2.9.3
jinja2 : 3.1.2
IPython : 8.14.0
pandas_datareader: None
bs4 : 4.12.2
bottleneck : 1.3.7
brotli :
fastparquet : 2023.4.0
fsspec : 2023.6.0
gcsfs : 2023.6.0
matplotlib : 3.7.1
numba : 0.57.0
numexpr : 2.8.4
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 12.0.0
pyreadstat : 1.2.2
pyxlsb : 1.0.10
s3fs : 2023.6.0
scipy : 1.10.1
snappy :
sqlalchemy : 2.0.16
tables : 3.8.0
tabulate : 0.9.0
xarray : 2023.5.0
xlrd : 2.0.1
zstandard : 0.19.0
tzdata : 2023.3
qtpy : None
pyqt5 : None

@tpaxman tpaxman added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 21, 2023
@lithomas1
Copy link
Member

Can you build the docs in serial?

Or just build the single problematic page?
python make.py --single getting_started/intro_tutorials/04_plotting.rst

This should give you the exact warning.

@lithomas1 lithomas1 added Docs Needs Info Clarification about behavior needed to assess issue Warnings Warnings that appear or should be added to pandas and removed Needs Triage Issue that has not been reviewed by a pandas team member Bug labels Jun 21, 2023
@tpaxman
Copy link
Contributor Author

tpaxman commented Jun 22, 2023

Thanks @lithomas1, I've done that now. Looks like it might be related to the plt.show() call which is strange as I imagine it typically builds without an issue. Any idea why that would be causing a failure? Looks like adding the :okwarning: flags in a few places solves the issue. See PR #53788. Have not yet rebuilt everything to see if other files are having the same issues. Any idea why this appears to be popping up somewhat sporadically with various rst files?

>>>-------------------------------------------------------------------------
Warning in /home/tpaxman/code/pandas-tpaxman/doc/source/getting_started/intro_tutorials/04_plotting.rst at block ending on line 70
Specify :okwarning: as an option in the ipython:: block to suppress this message
----------------------------------------------------------------------------
<ipython-input-6-1eb00ff78cf2>:1: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
  plt.show()
<<<-------------------------------------------------------------------------

Exception occurred:
  File "/home/tpaxman/mambaforge/envs/pandas-dev/lib/python3.10/site-packages/IPython/sphinxext/ipython_directive.py", line 600, in process_input
    raise RuntimeError('Non Expected warning in `{}` line {}'.format(filename, lineno))
RuntimeError: Non Expected warning in `/home/tpaxman/code/pandas-tpaxman/doc/source/getting_started/intro_tutorials/04_plotting.rst` line 70
The full traceback has been saved in /tmp/sphinx-err-_t3ju3ph.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

@lithomas1
Copy link
Member

Looks like something wrong with your matplotlib?

Could maybe also be a bad interaction with WSL. Does plotting figures in matplotlib without pandas work at all?

@tpaxman
Copy link
Contributor Author

tpaxman commented Jun 23, 2023

@lithomas1 thanks for the feedback. I'll try to see what might be wrong with my WSL then. That's strange that it wasn't giving me issues before so I wonder what I might have changed. If this problem is isolated to me only then I guess this could be closed for now.

@rhshadrach
Copy link
Member

rhshadrach commented Jun 25, 2023

I'm experiencing this locally too. This is also #44302.

Could maybe also be a bad interaction with WSL. Does plotting figures in matplotlib without pandas work at all?

I can currently plot with pandas, but when using sphinx I'm guessing a different backend is chosen?

I've added the following code to conf.py

import warnings

warnings.filterwarnings(
    "ignore",
    category=UserWarning,
    message="Matplotlib is currently using agg, which is a"
    " non-GUI backend, so cannot show the figure.",
)

and now the docs build fine - the plots appear as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Needs Info Clarification about behavior needed to assess issue Warnings Warnings that appear or should be added to pandas
Projects
None yet
3 participants