Closed andre-a-alves closed 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.
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).
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
@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.
@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.
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.
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.
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.
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,
Code Snippet
Error Output
Environment Context
Use the
about()
function to summarize information on operating system, python version and dependencies.Additional Python Environment Details (
conda list
):