5

I am setting up a documentation using mkdocs but I am getting "NotImplementedError" when runing the "mkdocs serve" command

Note that I am working on windows 10 and installed the Python 3.8.0a3 version

INFO    -  Building documentation... 
INFO    -  Cleaning site directory 
[I 190419 16:50:46 server:298] Serving on http://127.0.0.1:8000
Traceback (most recent call last):
  File "c:\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python38\Scripts\mkdocs.exe\__main__.py", line 9, in <module>
  File "c:\python38\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\python38\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\python38\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python38\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python38\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\python38\lib\site-packages\mkdocs\__main__.py", line 128, in serve_command
    serve.serve(
  File "c:\python38\lib\site-packages\mkdocs\commands\serve.py", line 124, in serve
    _livereload(host, port, config, builder, site_dir)
  File "c:\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:\python38\lib\site-packages\livereload\server.py", line 300, in serve
    self.application(
  File "c:\python38\lib\site-packages\livereload\server.py", line 255, in application
    app.listen(port, address=host)
  File "c:\python38\lib\site-packages\tornado\web.py", line 2112, in listen
    server.listen(port, address)
  File "c:\python38\lib\site-packages\tornado\tcpserver.py", line 152, in listen
    self.add_sockets(sockets)
  File "c:\python38\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "c:\python38\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "c:\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:\python38\lib\asyncio\events.py", line 498, in add_reader
    raise NotImplementedError
NotImplementedError

I would like to get where the error come from and fix it

2
  • Based on the traceback, the error is being raised by the asyncio library, which is called by tornado, which is called by livereload which is called by mkdocs. The problem could be anywhere in that chain of dependencies. I know MkDocs does not yet run its tests on Python 3.8. I'm not sure about any of the dependencies. My guess is that something is broken by the alpha version of Python you are using. But without a lot of debugging I don't know what. I'd start with asyncio and work my way backwards. Commented Apr 21, 2019 at 3:11
  • Accordingly to your answer, I successfully fixed it by downgrading my python's version to 3.7 ! Commented Apr 23, 2019 at 9:19

1 Answer 1

9

It seems like mkdocs does not the support the latest version of python which is 3.8.0a3. In my case I fixed it by downgrading to 3.7

Sign up to request clarification or add additional context in comments.

1 Comment

The command can be updated and "seems" replaced with confirmation and reference to github.com/mkdocs/mkdocs/issues/1885

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.