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
368 stars 163 forks source link

"make docs" raises error on Windows with Python 3.8 #689

Closed andre-a-alves closed 3 years ago

andre-a-alves commented 3 years ago

Pre-Report Checklist

Issue Description

This follows from me looking into why I could not successfully run "make doctest" during my last PR, while it ran fine here in Github.

On my Windows machine using fresh Anaconda environments and fresh clones of the repo, "make docs" and "make doctest" runs fine if I use Python 3.7, but I cannot run "make docs" if I am running Python 3.8.

I was just going to add a note in CONTRIBUTING.md that "make docs" needs to be run before "make doctest," because I realized that was my issue when using 3.7. But I would like to also be able to either mention Windows developers need to make sure they're using 3.7 or implement a fix to this.

How to Reproduce

In Windows,

  1. Create a new Conda environment with Python version 3.8
  2. Clone the repo
  3. Navigate the terminal to that directory
  4. Activate the new Conda environment

Code Snippet

pip install -e .
pip install -r dev_requirements.txt
make docs

Error Output

make -C docs html
make[1]: Entering directory `C:/Users/andre/PycharmProjects/mitiq/docs'
Running Sphinx v3.5.4
loading translations [en]... done
making output directory... done
checking for C:\Users\andre\PycharmProjects\mitiq\docs\source\refs.bib in bibtex cache... not found
parsing bibtex file C:\Users\andre\PycharmProjects\mitiq\docs\source\refs.bib... parsed 29 entries
myst v0.13.7: MdParserConfig(renderer='sphinx', commonmark_only=False, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, update_mathjax=True, enable_extensions=['amsmath', 'colon_fence', 'deflist', 'dollarmath', 'html_image', 'smartquotes'], disable_syntax=[], url_schemes=('http', 'https', 'mailto'), heading_anchors=None, html_meta=[], footnote_transition=True, substitutions=[], sub_delimiters=['{', '}'])
loading intersphinx inventory from https://docs.python.org/3.7/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/numpy/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/scipy/reference/objects.inv...
loading intersphinx inventory from https://pyquil-docs.rigetti.com/en/stable/objects.inv...
loading intersphinx inventory from https://qiskit.org/documentation/objects.inv...
loading intersphinx inventory from http://qutip.org/docs/latest/objects.inv...
intersphinx inventory has moved: http://qutip.org/docs/latest/objects.inv -> https://qutip.org/docs/latest/objects.inv
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 24 source files that are out of date
updating environment: executing outdated notebooks... Executing: C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\test.myst
Executing: C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\simple_landscape.myst
Executing: C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\maxcut-demo.myst
done
[new config] 24 added, 0 changed, 0 removed
--- Logging error --- 4%] apidoc
Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\cirq\__init__.py", line 576, in <module>
    _compat.deprecated_submodule(
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\cirq\_compat.py", line 546, in deprecated_submodule
    new_module = importlib.import_module(new_module_name)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'cirq_google'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\logging\__init__.py", line 1085, in emit
    msg = self.format(record)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\logging\__init__.py", line 929, in format
    return fmt.format(record)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\logging\__init__.py", line 668, in format
    record.message = record.getMessage()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\logging\__init__.py", line 373, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\andre\anaconda3\envs\mitiq_env\Scripts\sphinx-build.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\cmd\build.py", line 292, in main
    return make_main(argv)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\cmd\build.py", line 199, in make_main
    return make_mode.run_make_mode(argv[1:])
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\cmd\make_mode.py", line 166, in run_make_mode
    return make.run_generic_build(args[0])
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\cmd\make_mode.py", line 154, in run_generic_build
    return build_main(args + opts)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\cmd\build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\application.py", line 352, in build
    self.builder.build_update()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\builders\__init__.py", line 296, in build_update
    self.build(to_build,
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\builders\__init__.py", line 310, in build
    updated_docnames = set(self.read())
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\builders\__init__.py", line 417, in read
    self._read_serial(docnames)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\builders\__init__.py", line 438, in _read_serial
    self.read_doc(docname)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\builders\__init__.py", line 478, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\io.py", line 221, in read_doc
    pub.publish()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\core.py", line 217, in publish
    self.document = self.reader.read(self.source, self.parser,
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\io.py", line 126, in read
    self.parse()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\readers\__init__.py", line 77, in parse
    self.parser.parse(self.input, document)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\parsers.py", line 104, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 170, in run
    results = StateMachineWS.run(self, input_lines, input_offset,
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 2769, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 393, in new_subsection
    newabsoffset = self.nested_parse(
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 281, in nested_parse
    state_machine.run(block, input_offset, memo=self.memo,
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 196, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\statemachine.py", line 241, in run
    context, next_state, result = self.check_line(
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\statemachine.py", line 459, in check_line
    return method(match, context, next_state)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 2342, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 2354, in explicit_construct
    return method(self, expmatch)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 2096, in directive
    return self.run_directive(
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\docutils\parsers\rst\states.py", line 2146, in run_directive
    result = directive_instance.run()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\ext\autodoc\directive.py", line 167, in run
    documenter.generate(more_content=self.content)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\ext\autodoc\__init__.py", line 904, in generate    if not self.import_object():
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\ext\autodoc\__init__.py", line 1018, in import_object
    ret = super().import_object(raiseerror)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\ext\autodoc\__init__.py", line 421, in import_object
    ret = import_object(self.modname, self.objpath, self.objtype,
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\ext\autodoc\importer.py", line 92, in import_object
    module = import_module(modname, warningiserror=warningiserror)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\sphinx\ext\autodoc\importer.py", line 71, in import_module
    return importlib.import_module(modname)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\andre\PycharmProjects\mitiq\mitiq\__init__.py", line 16, in <module>
    from mitiq._about import about
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\andre\PycharmProjects\mitiq\mitiq\_about.py", line 23, in <module>
    from cirq import __version__ as cirq_version
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\cirq\__init__.py", line 585, in <module>
    warning("Can't import cirq.google: ", ex)
Message: "Can't import cirq.google: "
Arguments: (ModuleNotFoundError("No module named 'cirq_google'"),)
reading sources... [100%] zz_bibliography

Warning, treated as error:
C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\test.myst
Exception ignored in: <function Socket.__del__ at 0x000001FE3A8FC670>
Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\sugar\socket.py", line 66, in __del__
    self.close()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\_future.py", line 168, in close
    self._clear_io_state()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\asyncio.py", line 58, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\asyncio\events.py", line 504, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000001FE3A8FC670>
Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\sugar\socket.py", line 66, in __del__
    self.close()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\_future.py", line 168, in close
    self._clear_io_state()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\asyncio.py", line 58, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\asyncio\events.py", line 504, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000001FE3A8FC670>
Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\sugar\socket.py", line 66, in __del__
    self.close()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\_future.py", line 168, in close
    self._clear_io_state()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\asyncio.py", line 58, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\asyncio\events.py", line 504, in remove_reader
    raise NotImplementedError
NotImplementedError:
make[1]: *** [html] Error 2
make[1]: Leaving directory `C:/Users/andre/PycharmProjects/mitiq/docs'
make: *** [docs] Error 2

Environment Context

Use the about() function to summarize information on operating system, python version and dependencies.

Mitiq: A Python toolkit for implementing error mitigation on quantum computers
==============================================================================
Authored by: Mitiq team, 2020 & later (https://github.com/unitaryfund/mitiq)

Mitiq Version:  0.9.0dev

Core Dependencies
-----------------
Cirq Version:   0.11.0
NumPy Version:  1.20.3
SciPy Version:  1.4.1

Optional Dependencies
---------------------
PyQuil Version: 2.28.1
Qiskit Version: None
    Qiskit Elements:
        Terra : 0.16.4
        Aer : 0.7.6
        IBMQ-Provider : 0.12.3

Python Version: 3.8.10
Platform Info:  Windows (AMD64)

Additional Python Environment Details (conda list):

# packages in environment at C:\Users\andre\anaconda3\envs\mitiq_env:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.12                   pypi_0    pypi
amazon-braket-default-simulator 1.1.1.post2              pypi_0    pypi
amazon-braket-schemas     1.1.4                    pypi_0    pypi
amazon-braket-sdk         1.5.16                   pypi_0    pypi
anyio                     3.1.0                    pypi_0    pypi
apipkg                    1.5                      pypi_0    pypi
appdirs                   1.4.4                    pypi_0    pypi
argon2-cffi               20.1.0                   pypi_0    pypi
async-generator           1.10                     pypi_0    pypi
atomicwrites              1.4.0                    pypi_0    pypi
attrs                     20.3.0                   pypi_0    pypi
babel                     2.9.1                    pypi_0    pypi
backcall                  0.2.0                    pypi_0    pypi
backoff                   1.10.0                   pypi_0    pypi
beautifulsoup4            4.9.3                    pypi_0    pypi
black                     19.10b0                  pypi_0    pypi
bleach                    3.3.0                    pypi_0    pypi
boltons                   21.0.0                   pypi_0    pypi
boto3                     1.17.77                  pypi_0    pypi
botocore                  1.20.77                  pypi_0    pypi
ca-certificates           2021.4.13            haa95532_1
certifi                   2020.12.5        py38haa95532_0
cffi                      1.14.5                   pypi_0    pypi
chardet                   4.0.0                    pypi_0    pypi
cirq-core                 0.11.0                   pypi_0    pypi
click                     8.0.1                    pypi_0    pypi
colorama                  0.4.4                    pypi_0    pypi
coverage                  5.5                      pypi_0    pypi
cryptography              3.4.7                    pypi_0    pypi
cycler                    0.10.0                   pypi_0    pypi
cython                    0.29.23                  pypi_0    pypi
decorator                 4.4.2                    pypi_0    pypi
defusedxml                0.7.1                    pypi_0    pypi
dill                      0.3.3                    pypi_0    pypi
docutils                  0.16                     pypi_0    pypi
entrypoints               0.3                      pypi_0    pypi
execnet                   1.8.0                    pypi_0    pypi
fastjsonschema            2.15.1                   pypi_0    pypi
flake8                    3.7.9                    pypi_0    pypi
gitdb                     4.0.7                    pypi_0    pypi
gitpython                 3.1.17                   pypi_0    pypi
idna                      2.10                     pypi_0    pypi
imagesize                 1.2.0                    pypi_0    pypi
immutables                0.6                      pypi_0    pypi
importlib-metadata        4.0.1                    pypi_0    pypi
iniconfig                 1.1.1                    pypi_0    pypi
ipykernel                 5.5.5                    pypi_0    pypi
ipython                   7.23.1                   pypi_0    pypi
ipython-genutils          0.2.0                    pypi_0    pypi
ipywidgets                7.6.3                    pypi_0    pypi
jedi                      0.18.0                   pypi_0    pypi
jinja2                    3.0.1                    pypi_0    pypi
jmespath                  0.10.0                   pypi_0    pypi
jsonschema                3.2.0                    pypi_0    pypi
jupyter-cache             0.4.2                    pypi_0    pypi
jupyter-client            6.1.12                   pypi_0    pypi
jupyter-core              4.7.1                    pypi_0    pypi
jupyter-server            1.8.0                    pypi_0    pypi
jupyter-server-mathjax    0.2.2                    pypi_0    pypi
jupyter-sphinx            0.3.2                    pypi_0    pypi
jupyterlab-widgets        1.0.0                    pypi_0    pypi
kiwisolver                1.3.1                    pypi_0    pypi
lark                      0.11.3                   pypi_0    pypi
latexcodec                2.0.1                    pypi_0    pypi
markdown-it-py            0.6.2                    pypi_0    pypi
markupsafe                2.0.1                    pypi_0    pypi
matplotlib                3.4.2                    pypi_0    pypi
matplotlib-inline         0.1.2                    pypi_0    pypi
mccabe                    0.6.1                    pypi_0    pypi
mdit-py-plugins           0.2.6                    pypi_0    pypi
mistune                   0.8.4                    pypi_0    pypi
mitiq                     0.9.0.dev0                dev_0    <develop>
mpmath                    1.2.1                    pypi_0    pypi
msgpack                   0.6.2                    pypi_0    pypi
myst-nb                   0.12.3                   pypi_0    pypi
myst-parser               0.13.7                   pypi_0    pypi
nbclient                  0.5.3                    pypi_0    pypi
nbconvert                 5.6.1                    pypi_0    pypi
nbdime                    3.0.0                    pypi_0    pypi
nbformat                  5.1.3                    pypi_0    pypi
nest-asyncio              1.5.1                    pypi_0    pypi
networkx                  2.5.1                    pypi_0    pypi
notebook                  6.4.0                    pypi_0    pypi
ntlm-auth                 1.5.0                    pypi_0    pypi
numpy                     1.20.3                   pypi_0    pypi
openssl                   1.1.1k               h2bbff1b_0
opt-einsum                3.3.0                    pypi_0    pypi
packaging                 20.9                     pypi_0    pypi
pandas                    1.2.4                    pypi_0    pypi
pandocfilters             1.4.3                    pypi_0    pypi
parso                     0.8.2                    pypi_0    pypi
pathspec                  0.8.1                    pypi_0    pypi
pickleshare               0.7.5                    pypi_0    pypi
pillow                    8.2.0                    pypi_0    pypi
pip                       21.0.1           py38haa95532_0
pluggy                    0.13.1                   pypi_0    pypi
ply                       3.11                     pypi_0    pypi
prometheus-client         0.10.1                   pypi_0    pypi
prompt-toolkit            3.0.18                   pypi_0    pypi
psutil                    5.8.0                    pypi_0    pypi
py                        1.10.0                   pypi_0    pypi
pybind11                  2.6.2                    pypi_0    pypi
pybtex                    0.24.0                   pypi_0    pypi
pybtex-docutils           1.0.0                    pypi_0    pypi
pycodestyle               2.5.0                    pypi_0    pypi
pycparser                 2.20                     pypi_0    pypi
pydantic                  1.8.2                    pypi_0    pypi
pydata-sphinx-theme       0.6.3                    pypi_0    pypi
pyflakes                  2.1.1                    pypi_0    pypi
pygments                  2.9.0                    pypi_0    pypi
pyparsing                 2.4.7                    pypi_0    pypi
pyquil                    2.28.1                   pypi_0    pypi
pyrsistent                0.17.3                   pypi_0    pypi
pytest                    6.2.4                    pypi_0    pypi
pytest-cov                2.11.1                   pypi_0    pypi
pytest-forked             1.3.0                    pypi_0    pypi
pytest-xdist              2.2.1                    pypi_0    pypi
python                    3.8.10               hdbf39b2_7
python-constraint         1.4.0                    pypi_0    pypi
python-dateutil           2.8.1                    pypi_0    pypi
python-rapidjson          1.0                      pypi_0    pypi
pytz                      2021.1                   pypi_0    pypi
pywin32                   300                      pypi_0    pypi
pywinpty                  1.1.1                    pypi_0    pypi
pyyaml                    5.4.1                    pypi_0    pypi
pyzmq                     22.0.3                   pypi_0    pypi
qiskit-aer                0.7.6                    pypi_0    pypi
qiskit-ibmq-provider      0.12.3                   pypi_0    pypi
qiskit-terra              0.16.4                   pypi_0    pypi
regex                     2021.4.4                 pypi_0    pypi
requests                  2.25.1                   pypi_0    pypi
requests-ntlm             1.1.0                    pypi_0    pypi
retworkx                  0.8.0                    pypi_0    pypi
rpcq                      3.9.1                    pypi_0    pypi
ruamel-yaml               0.17.4                   pypi_0    pypi
ruamel-yaml-clib          0.2.2                    pypi_0    pypi
s3transfer                0.4.2                    pypi_0    pypi
scipy                     1.4.1                    pypi_0    pypi
send2trash                1.5.0                    pypi_0    pypi
setuptools                52.0.0           py38haa95532_0
six                       1.16.0                   pypi_0    pypi
smmap                     4.0.0                    pypi_0    pypi
sniffio                   1.2.0                    pypi_0    pypi
snowballstemmer           2.1.0                    pypi_0    pypi
sortedcontainers          2.4.0                    pypi_0    pypi
soupsieve                 2.2.1                    pypi_0    pypi
sphinx                    3.5.4                    pypi_0    pypi
sphinx-autodoc-typehints  1.12.0                   pypi_0    pypi
sphinx-copybutton         0.3.1                    pypi_0    pypi
sphinx-togglebutton       0.2.3                    pypi_0    pypi
sphinxcontrib-applehelp   1.0.2                    pypi_0    pypi
sphinxcontrib-bibtex      2.2.1                    pypi_0    pypi
sphinxcontrib-devhelp     1.0.2                    pypi_0    pypi
sphinxcontrib-htmlhelp    1.0.3                    pypi_0    pypi
sphinxcontrib-jsmath      1.0.1                    pypi_0    pypi
sphinxcontrib-qthelp      1.0.3                    pypi_0    pypi
sphinxcontrib-serializinghtml 1.1.4                    pypi_0    pypi
sqlalchemy                1.3.24                   pypi_0    pypi
sqlite                    3.35.4               h2bbff1b_0
sympy                     1.8                      pypi_0    pypi
terminado                 0.10.0                   pypi_0    pypi
testpath                  0.5.0                    pypi_0    pypi
toml                      0.10.2                   pypi_0    pypi
tornado                   6.1                      pypi_0    pypi
tqdm                      4.60.0                   pypi_0    pypi
traitlets                 5.0.5                    pypi_0    pypi
typed-ast                 1.4.3                    pypi_0    pypi
typing-extensions         3.10.0.0                 pypi_0    pypi
urllib3                   1.26.4                   pypi_0    pypi
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wcwidth                   0.2.5                    pypi_0    pypi
webencodings              0.5.1                    pypi_0    pypi
websocket-client          1.0.0                    pypi_0    pypi
websockets                9.0.2                    pypi_0    pypi
wheel                     0.36.2             pyhd3eb1b0_0
widgetsnbextension        3.5.1                    pypi_0    pypi
wincertstore              0.2                      py38_0
zipp                      3.4.1                    pypi_0    pypi
github-actions[bot] commented 3 years ago

Hello @andre-a-alves, thank you for your interest in Mitiq! If this is a bug report, please provide screenshots and/or minimum viable code to reproduce your issue, so we can do our best to help get it fixed. If you have any questions in the meantime, you can also ask us on the Unitary Fund Discord.

purva-thakre commented 3 years ago

I am unable to replicate your error. But it does seem like circ-google is not installed. This is not specified as a dependency in either requirements.txt or dev_requirements.txt. In addition, none of the requirements for circ-google are installed in your environment.

The installation guide also seems a bit ambiguous by trying to state that if you install one, the other one is installed as well. I am a bit confused as to if this statement refers to installing the pre-release version only.

Edit - I was able to replicate the error in Linux for Python 3.8.5. If I install circ-google then the test passes. Did this module get installed in Python 3.7 ? The docs build fails below due to an issue with sphinx-autodoc (an older version is installed).

andre-a-alves commented 3 years ago

I tried again by manually adding those two modules (cirq-google and cirq-core) before installing everything, and I still get the docs failure on Windows - error message below.

Even without me adding those modules, cirq-core shows up in conda list for both 3.7 and 3.8 after pip install -e ..

I am going to keep working on it and document any progress here, especially since I think there are only two of us developing in Windows where this error is showing up.

make -C docs html
make[1]: Entering directory `C:/Users/andre/PycharmProjects/mitiq/docs'
Running Sphinx v3.5.4
loading translations [en]... done
making output directory... done
checking for C:\Users\andre\PycharmProjects\mitiq\docs\source\refs.bib in bibtex cache... not found
parsing bibtex file C:\Users\andre\PycharmProjects\mitiq\docs\source\refs.bib... parsed 29 entries
myst v0.13.7: MdParserConfig(renderer='sphinx', commonmark_only=False, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, update_mathjax=True, enable_extensions=['amsmath', 'colon_fence', 'deflist', 'dollarmath', 'html_image', 'smartquotes'], disable_syntax=[], url_schemes=('http', 'https', 'mailto'), heading_anchors=None, html_meta=[], footnote_transition=True, substitutions=[], sub_delimiters=['{', '}'])
loading intersphinx inventory from https://docs.python.org/3.7/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/numpy/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/scipy/reference/objects.inv...
loading intersphinx inventory from https://pyquil-docs.rigetti.com/en/stable/objects.inv...
loading intersphinx inventory from https://qiskit.org/documentation/objects.inv...
loading intersphinx inventory from http://qutip.org/docs/latest/objects.inv...
intersphinx inventory has moved: http://qutip.org/docs/latest/objects.inv -> https://qutip.org/docs/latest/objects.inv
intersphinx inventory has moved: https://docs.scipy.org/doc/numpy/objects.inv -> https://numpy.org/doc/stable/objects.inv
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 24 source files that are out of date
updating environment: executing outdated notebooks... Executing: C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\maxcut-demo.myst
Executing: C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\simple_landscape.myst
Executing: C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\test.myst
done
[new config] 24 added, 0 changed, 0 removed
reading sources... [  4%] apidoc
Warning, treated as error:
C:\Users\andre\PycharmProjects\mitiq\docs\source\examples\maxcut-demo.myst
Exception ignored in: <function Socket.__del__ at 0x000001C5269E7CA0>
Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\sugar\socket.py", line 66, in __del__
    self.close()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\_future.py", line 168, in close
    self._clear_io_state()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\asyncio.py", line 58, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\asyncio\events.py", line 504, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000001C5269E7CA0>
Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\sugar\socket.py", line 66, in __del__
    self.close()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\_future.py", line 168, in close
    self._clear_io_state()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\asyncio.py", line 58, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\asyncio\events.py", line 504, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000001C5269E7CA0>
Traceback (most recent call last):
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\sugar\socket.py", line 66, in __del__
    self.close()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\_future.py", line 168, in close
    self._clear_io_state()
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\site-packages\zmq\asyncio.py", line 58, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "c:\users\andre\anaconda3\envs\mitiq_env\lib\asyncio\events.py", line 504, in remove_reader
    raise NotImplementedError
NotImplementedError:
make[1]: *** [html] Error 2
make[1]: Leaving directory `C:/Users/andre/PycharmProjects/mitiq/docs'
make: *** [docs] Error 2
purva-thakre commented 3 years ago

@andre-a-alves I actually work in Linux 😄 . I do not think the issue is with what system is being used but with Sphinx and other Sphinx based packages.

When I tried to use make docs with just circq-core installed, I did get the same error as you. So, I added cirq-google to the requirements file and the build passed locally (on Python 3.8.5). But it fails on Github due to an issue with an older version of Sphinx. I did try to bump up to the latest version but pip gets lost trying to resolve the dependencies.

I think we need to figure out which newer version of Sphinx works with other doc dependencies or if the error is specific to Python's version. A workflow run uses Python 3.8.10.

andre-a-alves commented 3 years ago

@purva-thakre That makes sense. I can start looking into Sphinx versions unless you've already started going down that rabbit hole. I know this morning I briefly looked at whether version 4 would work, but it appeared to have a few dependency issues to work out, and I didn't have the time to pull on that thread.

purva-thakre commented 3 years ago

unless you've already started going down that rabbit hole

@andre-a-alves Not yet. You are more than welcome to give it a try.

andre-a-alves commented 3 years ago

I cannot speak to errors on Linux, but shortly I will be attaching a PR to solve this problem for Windows. As discussed in the meeting yesterday, the cirq.google Module Not Found error is ignored.

The inability to run make docs or make doctest in Windows if the environment is using Python 3.8 stems from asyncio, which changed its default event loop beginning with Python 3.8. The new event loop does not have support for Unix-style APIs that are used by Tornado, and consequently Jupyter - a problem that is more significant when run on a non-Unix-like system. Fixing the issue just requires the user to modify a few lines in asyncio's __init__.py file within their environment.

Regarding the Sphinx version, myst-parser does not yet support Sphinx 4.0, which only left beta earlier this month. We are using 3.5.4, which is the latest pre-4.0 version.

purva-thakre commented 3 years ago

If I install circ-google then it fails similar to above test PR because of circ.google. It's great you found that it was a Windows issue.