Nbconvert: test failure on master

Created on 30 Sep 2016  路  13Comments  路  Source: jupyter/nbconvert

I currently get the following test failures. What am I doing wrong?

Thanks!

======================================================================
ERROR: Can a notebook be exported by filename?
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/exporter_locator.py", line 84, in export_by_name
    Exporter = get_exporter(format_name)
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/base.py", line 110, in get_exporter
    % (name, ', '.join(get_export_names())))
ValueError: Unknown exporter "python", did you mean one of: ?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/tests/test_export.py", line 38, in test_export_filename
    (output, resources) = export_by_name('python', self._get_notebook())
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/exporter_locator.py", line 87, in export_by_name
    raise ExporterNameError("Exporter for `%s` not found" % format_name)
nbconvert.exporters.base.ExporterNameError: Exporter for `python` not found

======================================================================
ERROR: Can a notebook be exported by a filesteam?
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/exporter_locator.py", line 84, in export_by_name
    Exporter = get_exporter(format_name)
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/base.py", line 110, in get_exporter
    % (name, ', '.join(get_export_names())))
ValueError: Unknown exporter "python", did you mean one of: ?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/tests/test_export.py", line 57, in test_export_filestream
    (output, resources) = export_by_name('python', f)
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/exporter_locator.py", line 87, in export_by_name
    raise ExporterNameError("Exporter for `%s` not found" % format_name)
nbconvert.exporters.base.ExporterNameError: Exporter for `python` not found

======================================================================
ERROR: Can a notebook be exported by a notebook node handle?
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/exporter_locator.py", line 84, in export_by_name
    Exporter = get_exporter(format_name)
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/base.py", line 110, in get_exporter
    % (name, ', '.join(get_export_names())))
ValueError: Unknown exporter "python", did you mean one of: ?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/tests/test_export.py", line 48, in test_export_nbnode
    (output, resources) = export_by_name('python', notebook)
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/exporter_locator.py", line 87, in export_by_name
    raise ExporterNameError("Exporter for `%s` not found" % format_name)
nbconvert.exporters.base.ExporterNameError: Exporter for `python` not found

======================================================================
ERROR: delegate to custom exporter from language_info
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/tests/test_script.py", line 42, in test_export_python
    (output, resources) = self.exporter_class().from_notebook_node(pynb)
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/script.py", line 29, in from_notebook_node
    Exporter = get_exporter(exporter_name)
  File "/home/andy/checkout/nbconvert/nbconvert/exporters/base.py", line 110, in get_exporter
    % (name, ', '.join(get_export_names())))
ValueError: Unknown exporter "python", did you mean one of: ?
-------------------- >> begin captured logging << --------------------
root: DEBUG: Applying preprocessor: coalesce_streams
root: DEBUG: Attempting to load template script.tpl
root: DEBUG:     template_path: .
root: DEBUG: Loaded template /home/andy/checkout/nbconvert/nbconvert/exporters/../templates/script.tpl
root: DEBUG: Loading script exporter: python
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: --template '/path/to/template.tpl'
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/tests/test_nbconvertapp.py", line 100, in test_absolute_template_file
    self.nbconvert('--log-level 0 notebook2 --template %s' % template)
  File "/home/andy/checkout/nbconvert/nbconvert/tests/base.py", line 151, in nbconvert
    raise OSError(bytes_to_str(stderr))
OSError: Traceback (most recent call last):
  File "/home/andy/anaconda3/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/andy/anaconda3/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/__main__.py", line 2, in <module>
    main()
  File "/home/andy/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 596, in launch_instance
    app.start()
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py", line 293, in start
    self.convert_notebooks()
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py", line 457, in convert_notebooks
    self.convert_single_notebook(notebook_filename)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py", line 428, in convert_single_notebook
    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py", line 357, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py", line 165, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py", line 183, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/html.py", line 65, in from_notebook_node
    return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/templateexporter.py", line 203, in from_notebook_node
    output = self.template.render(nb=nb_copy, resources=resources)
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/templateexporter.py", line 80, in template
    self._template_cached = self._load_template()
  File "/home/andy/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/templateexporter.py", line 186, in _load_template
    raise TemplateNotFound(self.template_file)
jinja2.exceptions.TemplateNotFound: /tmp/tmpkz6q352j/mytemplate.tpl


======================================================================
ERROR: Check if figure files are copied to configured path.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/andy/checkout/nbconvert/nbconvert/tests/test_nbconvertapp.py", line 435, in test_write_figures_to_custom_path
    assert fig_exists(path)
  File "/home/andy/checkout/nbconvert/nbconvert/tests/test_nbconvertapp.py", line 424, in fig_exists
    return (len(os.listdir(path)) > 0)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmprzm9atnz/files'

----------------------------------------------------------------------

Most helpful comment

No I mean, uninstall and reinstall (pip uninstall nbconvert; pip install nbconvert).

Does it work then?

All 13 comments

This is confusing me, in what context are you running into these errors? When I run py.test on master I do not run into this and when I check travisCI these don't seem to arise

What I'm thinking this might be related to is that for some reason your installation isn't finding the entrypoints for declaring exporters in the get_exporter_names(), and it was only working before because they were hard coded and the hard coded versions were removed from that call in a recent update.

Hm never mind. I did pip install -e . again and now it works. Sorry for the noise.

no worries!

@michaelpacer the downside of relying on entry points is that if the entry points themselves change in any way, people with a development install need to set it up again to get that change. I ran into this as well shortly after the change.

Hi there, I have the same problem:

Traceback (most recent call last): File "/usr/local/bin/jupyter-nbconvert", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/usr/local/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance app.start() File "/usr/local/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 305, in start self.convert_notebooks() File "/usr/local/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 462, in convert_notebooks cls = get_exporter(self.export_format) File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/base.py", line 110, in get_exporter % (name, ', '.join(get_export_names()))) ValueError: Unknown exporter "html", did you mean one of: ?

(nbconvert (5.0.0), Python 2.7.13)

Did you try a fresh installation?

It looks like get_export_names() isn't returning anything for you, it relies on entrypoints specifically via entrypoints.get_group_named('nbconvert.exporters') (see here) which makes me think that your entrypoints aren't updated. It may require reinstalling to reset these as @takluyver states here.

@michaelpacer hmm, I've just pip install -U'd nbconvert, but nothung changed.

Do you mean installation via pip install -e?

No I mean, uninstall and reinstall (pip uninstall nbconvert; pip install nbconvert).

Does it work then?

@michaelpacer yes! thank you a lot!

Huzzah! Glad to help; it always feels good to end the night on a positive note :)!

@takluyver Why does an upgrade not work to reset the entrypoints, when the entrypoints have changed between versions (which presumably is what caused the breakage in the first place)?

If pip install -U decides that you already have an up-to-date version of the thing you're trying to install, it doesn't install it again. Sometimes it seems to decide this when it's not accurate, especially if you've installed from a source checkout rather than a package. I'm not 100% sure why it would have in this case, but any time problems with package installation are suspected, uninstalling and installing again is a good idea.

Was this page helpful?
0 / 5 - 0 ratings