jupyter-book: jupyter-book build: NotImplementedError on Windows Python 3.8

Maintainer Edit:

This issue is related to jupyter/nbclient#85

So it looks like, for now on Windows, you need to use Python 3.7.


Describe the bug

I am following the tutorial set-up https://jupyterbook.org/start/build.html In the second step it says use jupyter-book build mybookname to build the book - i get an error. Here is an error: File "C:\Program Files\Python38\lib\asyncio\events.py", line 501, in add_reader raise NotImplementedError NotImplementedError Here is a screenshot of my terminal: image

To Reproduce

Steps to reproduce the behavior:

  1. pip install -U jupyter-book
  2. jupyter-book create mybookname
  3. jupyter-book build mybookname

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 5
  • Comments: 67 (31 by maintainers)

Most upvoted comments

@chrisjsewell (I hope you’re the right person to tag) this seems to be fixed now from Tornado==6.1 and pyzmq==22.1.0 From cpython 3.8, ayncio changed the default eventloop and it basically broke Tornado. Their 6.1 release finally fixed that. I am able to successfully build a book using cpython 3.9 and jbook 0.12.1 using these dependency versions.

What docs/build steps/requirements would need to be updated to confirm/inform about this fix? here and here are the most obvious. Probably pin these versions in the setup.cfg? How does the CI work? does it do any automated windows testing?

For anyone that stumbles on to this and is looking for the fix, here is what worked:

pip uninstall jupyter-book
conda create -n workenv python=3.7
conda activate workenv
pip install jupyter-book

Description of what the steps above:

  • uninstall jupyter-book (for some reason it has a dash on windows but no dash on macOS/linux!)
  • create a new conda environment with python 3.7 (thanks @phaustin!)
  • activate the env
  • reinstall jupyter-book

I am not 100% sure uninstalling and reinstalling jupyter-book is necessary, but after it worked, I wasn’t going to touch it again!

right – things will get smoother eventually, but at the moment it is sort of like teaching people to drive while we are paving the road and assembling the car. The other important thing is to install jupyter-book from the branch that has the windows patches applied:

pip install git+https://github.com/phaustin/jupyter-book@posix_path --upgrade

as of today, this version allows me to build the documentation for jupyter-book: https://jupyterbook.org/intro.html so as long as you keep to that format it should work with windows.

sheesh – that’s a new one. Seems like it might be a network problem. If it keeps failing at the same point, I might try specfying a prior python like 3.7.6 and in case there’s something wrong with the 3.7.7 file on the conda server.

right – you defintely want to avoid anaconda. Your environments should only have the minimum set of packages you need to work on a specific project. Anything more than that is just extra complexity to debug.

to get a conda environment with jupyter-book and python 3.7:

conda create -n py37 python=3.7
conda activate py37
conda install pip
pip install jupyter-book

I have just updated my pip and running --use-feature

Heya thanks, looks like an nbclient issues. Could you provide the full traceback (drag and drop the referenced log file into a comment), and the version of nbclient installed: pip show nbclient

I notice also that you are using the latest version of myst-parser/myst-nb. This is not yet strictly supported by jupyter-book (coming in the next day or 2!). I imagine if you run pip check, it will highlight a number of version incompatibilities?