unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
363 stars 160 forks source link

Bug while building the docs due to sphinx_rtd_theme or pydata_sphinx_theme #203

Closed nathanshammah closed 4 years ago

nathanshammah commented 4 years ago

Running

sudo pip install -e .[development]

on a server with a ubuntu virtual machine and then trying from mitiq/docs

make html

gives the error

Theme error: sphinx_rtd_theme is no longer a hard dependency since version 1.4.0. Please install it manually.(pip install sphinx_rtd_theme)

Somehow this was not picked up by any dev testing environment (CI or local). mitiq.about.about() reads

Mitiq: A Python toolkit for implementing 
error mitigation on quantum computers.
========================================
Mitiq team – 2020 and later.
See https://github.com/unitaryfund/mitiq for details.

Mitiq Version:      0.1a1
Numpy Version:      1.18.4
Scipy Version:      1.4.1
Cirq Version:       0.8.1
Pyquil Version:     2.18.0
Qiskit Version:     0.12.0
Python Version:     3.7.7
Platform Info:      Linux (x86_64)

This may be an error occurring due to user privilege on the server, and solved with

sudo make html

I will check that.

Otherwise we may need to add a pip install sphinx sphinx_rtd_theme, i.e, updating development_requirements.txt with sphinx_rtd_theme~=0.4.3

willzeng commented 4 years ago

I got this error, but if I attempt the fix of manually installing sphinx I get:

Exception occurred:
  File "/Users/will/envs/mitiq/lib/python3.7/site-packages/sphinx/application.py", line 1084, in add_source_parser
    self.registry.add_source_parser(*args, **kwargs)
TypeError: add_source_parser() takes 2 positional arguments but 3 were given
The full traceback has been saved in /var/folders/ls/yc7c862d7dlc7mjb3kwk1m0w0000gn/T/sphinx-err-ed7nmald.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!
make: *** [html] Error 2
willzeng commented 4 years ago

@nathanshammah I just checked again on master and I still get the same error mentioned above.

rmlarose commented 4 years ago

Similar error on Pull #241.

Theme error:
no theme named 'pydata_sphinx_theme' found (missing theme.conf?)
make: *** [html] Error 2
Makefile:20: recipe for target 'html' failed

Full output

nathanshammah commented 4 years ago

Currently, we are not using anywhere anymore rtd-sphinx-theme. We are using pydata-sphinx-theme. So I will investigate Ryan's issue.

willzeng commented 4 years ago

I started a fresh virtual environment and was able to build the docs.

willzeng commented 4 years ago

ah wait. I was mistaken, I can run the doctests now but with make html I get:

Theme error:
no theme named 'pydata_sphinx_theme' found (missing theme.conf?)
make: *** [html] Error 2
willzeng commented 4 years ago

Looks like it was a missing dependency. Added a fix here: https://github.com/unitaryfund/mitiq/pull/244 @nathanshammah