Nbconvert 6.0.7 yields "ValueError" for all --to values other than "notebook"

I’ve just installed Python 3.9 on a Big Sur Apple Silicon M1 using Homebrew. Everything appears to be working as expected except for nbconvert.

I installed jupyter using pip3 as usual:

$ pip3 install jupyter

Running $ jupyter-nbconvert --to markdown my_notebook.ipynb yields:

ValueError: No template sub-directory with name 'markdown' found in the following paths:
	/Users/aciuffo/Library/Jupyter
	/opt/homebrew/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/share/jupyter
	/usr/local/share/jupyter
	/usr/share/jupyter

The only command that appears to function currently is:

$  jupyter nbconvert --to notebook my_project.ipynb       
[NbConvertApp] Converting notebook my_project.ipynb to notebook
[NbConvertApp] Writing 7598 bytes to my_project.nbconvert.ipynb

This leads me to believe that some part of nbconvert is missing, but I’m really at a loss.

My ~/.jupyter directory is completely empty at this point (no dot files even).

This has worked as expected with previous installs of nbconvert v6.

Any ideas? Is this a bug, or am I doing something very dumb?

After digging through the Github issues, I eventually found this closed thread. Apparently in some circumstances the environment can get børked and this leads to path issues.

I resolved this by completely removing the homebrew python environment, and started over using pyenv to build a new python 3.9 environment.

Here are the exact steps for others that might run into this:

  • brew uninstall python
  • brew install python
  • brew install pyenv
  • pyenv install 3.9.1
  • pyenv global 3.9.1
  • open a fresh terminal to ensure your shims are all properly active
    • test with: which python3 this should yield: /Users/foobar/.pyenv/shims/python if your pyenv version is active
  • pip3 install jupyter
1 Like