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

I have also fighted a lot because simple download of jupyter notebook was even impossible with last versions as it used to work before. I am aligned on latest versions of Python and jupyter and it is not advisable for me to downgrade modules to reestablish compatibility specially when my environnement is heavy with a lot of modules interconnected. I use pip and Win 7 and the web interface.

I see that my jupyter templates were installed under E:\program\Python\Python38\share\jupyter\nbconvert. As the jupyter “download as” shows the directories it searches in (look at the server error report), I have there 3 path (= 3 solutions) from where I chose to modify my C:\ProgramData\jupyter directory

C:\ProgramData\jupyter>dir
Répertoire de C:\ProgramData\jupyter

13/06/2021 10:13 .
13/06/2021 10:13 …
27/04/2021 18:00 kernels
26/04/2021 17:44 nbconvert

transforming the nbconvert sub-directory into a link to using dos command mklink after renaming the existing into “nbconvert~” becoming obsolete :

C:\ProgramData\jupyter>mklink /J nbconvert E:\program\Python\Python38\share\jupyter\nbconvert
Jonction créée pour nbconvert <<===>> E:\program\Python\Python38\share\jupyter\nbconvert

C:\ProgramData\jupyter>dir

Répertoire de C:\ProgramData\jupyter

13/06/2021 10:15 .
13/06/2021 10:15 …
27/04/2021 18:00 kernels
13/06/2021 10:15 nbconvert [E:\program\Python\Python38\share\jupyter\nbconvert]
26/04/2021 17:44 nbconvert~

Convertion is now operational.