mkdocs: Asyncio NotImplemented Error after Python 3.8.0
Using a new install of Python 3.8.0, pip installed latest version of MkDocs, and then tried to run mkdocs serve, which encountered the below error.
I tried again on a new docs directory (mkdocs new testing), but encountered the same issue again.
Python version: 3.8.0 OS: Windows 10 Pro v1709
error:
C:\dev\testing
λ mkdocs serve
INFO - Building documentation...
INFO - Cleaning site directory
[I 191017 14:49:48 server:296] Serving on http://127.0.0.1:8000
Traceback (most recent call last):
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\aleksandr.skobelev\AppData\Local\Programs\Python\Python38\Scripts\mkdocs.exe\__main__.py", line 9, in <module>
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\mkdocs\__main__.py", line 128, in serve_command
serve.serve(
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\mkdocs\commands\serve.py", line 124, in serve
_livereload(host, port, config, builder, site_dir)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\mkdocs\commands\serve.py", line 58, in _livereload
server.serve(root=site_dir, host=host, port=port, restart_delay=0)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\livereload\server.py", line 298, in serve
self.application(
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\livereload\server.py", line 253, in application
app.listen(port, address=host)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\tornado\web.py", line 2112, in listen
server.listen(port, address)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\tornado\tcpserver.py", line 152, in listen
self.add_sockets(sockets)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
self._handlers[sock.fileno()] = add_accept_handler(
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
io_loop.add_handler(sock, accept_handler, IOLoop.READ)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
File "c:\users\aleksandr.skobelev\appdata\local\programs\python\python38\lib\asyncio\events.py", line 501, in add_reader
raise NotImplementedError
NotImplementedError
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 18 (9 by maintainers)
Commits related to this issue
- Select asyncio event loop on Windows for PY3.8+ As of Python 3.8, the default event loop on Windows is `proactor`, however Tornado requires the old default "selector" event loop. As Tornado has decid... — committed to waylan/mkdocs by waylan 5 years ago
- Select asyncio event loop on Windows for PY3.8+ As of Python 3.8, the default event loop on Windows is `proactor`, however Tornado requires the old default "selector" event loop. As Tornado has decid... — committed to waylan/mkdocs by waylan 5 years ago
- Select asyncio event loop on Windows for PY3.8+ As of Python 3.8, the default event loop on Windows is `proactor`, however Tornado requires the old default "selector" event loop. As Tornado has decid... — committed to mkdocs/mkdocs by waylan 5 years ago
- Added explicit asyncio import and set_event_loop_policy to make tornado work with windows 10 and up import asyncio if sys.platform == 'win32': asyncio.set_event_loop_policy(asyncio.WindowsSel... — committed to gianpag/MongoDBAtlas-IBM-AIMLv2 by gianpag 4 years ago
@SaDiablo thanks for the update. I have used your error message to report the issue upstream to lepture/python-livereload#209. When we get a response there, it will inform us how to proceed here.
Yes, we know it is a problem. However, the problem is upstream and we can only wait for it to be fixed there. Adding “me too” reports will not change that.
As a test could someone who is getting the error confirm that the error also occurs when running these commands:
That runs livereload directly without MkDocs light wrapper. My expectation is that the error will also occur there. If it does, the error needs to be reported upstream to that project to be fixed. If it does not occur there, then we will fix it in MkDocs.
Confirmed. I am on Windows 10 1809 and I used source code from https://github.com/mkdocs/mkdocs/commit/2172c9f999b17201102732a53c08e3de0dd48c74 to edit serve.py. After restarting vscode and running mkdocs serve command I’m able to browse site on localhost:8000. Thank you mkdocs team for providing a fix.
This fix seems to work
I experienced the issue too and patched https://github.com/mkdocs/mkdocs/commit/cf2b136d4257787c0de51eba2d9e30ded5245b31 as my
serve.pyfor testing. I can confirm thatmkdocs serveis working now.I hope I’m doing this right as I’m just starting to use mkdocs or github. Maybe someone else can confirm too?
MkDocs is developed by volunteers in our spare time. Therefore it is impossible to provide a timeline. The best I can say it that the next release will be released when it is ready.
If you would like to help move things along, the 1.1 milestone provides a list of items which need to be resolved before the release is made.