Giter VIP home page Giter VIP logo

Comments (11)

kirbs- avatar kirbs- commented on May 31, 2024

Strange. I'll look into it. Looks like your using Python 3.6. Are you using anaconda too?

from hide_code.

lum4chi avatar lum4chi commented on May 31, 2024

No, virtualenv neither. I'm on Mac OS, brewed python and pip.

Edit: closing button pressed because slow reload on a touch screen ^^'

from hide_code.

leeclemmer avatar leeclemmer commented on May 31, 2024

Ran into the same exact problem. Having a print statement in the code starts generating 500 errors. Also on Mac OS. No virtualenv.

Uncaught exception GET /notebooks/Community/Print.ipynb/export/html (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Community/Print.ipynb/export/html', version='HTTP/1.1', remote_ip='::1', headers={'Accept-Language': 'en-US,en;q=0.8,de;q=0.6,ja;q=0.4,es;q=0.2,pt;q=0.2,cs;q=0.2,fr;q=0.2', 'Accept-Encoding': 'gzip, deflate, sdch, br', 'Host': 'localhost:8888', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36', 'Connection': 'keep-alive', 'Referer': 'http://localhost:8888/notebooks/Community/Print.ipynb', 'Cookie': '_xsrf=2|26dbddb9|eafafdf5adc4886dd4dc0fd07653ebb5|1485225470; username-localhost-8888="2|1:0|10:1485286696|23:username-localhost-8888|44:NjlkNDU5ZmVjNWJlNDJiNDlkMjFlODY3NDdmOWZkODU=|9ffcdd833b65310e0d013f642373948c465f8710e8d0f6281b741e0d576db36c"', 'Upgrade-Insecure-Requests': '1'})
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/tornado/web.py", line 1467, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/usr/local/lib/python2.7/site-packages/hide_code/hide_code.py", line 25, in get
        output_html, resources = exporter.from_notebook_node(nb)
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 69, in from_notebook_node
        return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 239, in from_notebook_node
        output = self.template.render(nb=nb_copy, resources=resources)
      File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/local/lib/python2.7/site-packages/hide_code/Templates/hide_code.tpl", line 1, in top-level template code
        {%- extends 'full.tpl' -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/html/full.tpl", line 2, in top-level template code
        {% from 'mathjax.tpl' import mathjax %}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 1, in top-level template code
        {%- extends 'display_priority.tpl' -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/display_priority.tpl", line 1, in top-level template code
        {%- extends 'null.tpl' -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 26, in top-level template code
        {%- block body -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/html/full.tpl", line 67, in block "body"
        {{ super() }}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 28, in block "body"
        {%- block any_cell scoped -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 30, in block "any_cell"
        {%- block codecell scoped -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 6, in block "codecell"
        {{ super() }}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 36, in block "codecell"
        {%- block output_group -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 19, in block "output_group"
        {{ super() }}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 38, in block "output_group"
        {%- block outputs scoped -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 40, in block "outputs"
        {%- block output scoped -%}
      File "/usr/local/lib/python2.7/site-packages/hide_code/Templates/hide_code.tpl", line 43, in block "output"
        {% block execute_result -%}	{{ super() }} {%- endblock execute_result %}
      File "/usr/local/lib/python2.7/site-packages/hide_code/Templates/hide_code.tpl", line 43, in block "execute_result"
        {% block execute_result -%}	{{ super() }} {%- endblock execute_result %}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 90, in block "execute_result"
        {% block data_priority scoped %}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 91, in block "data_priority"
        {{ super() }}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/exporters/../templates/skeleton/display_priority.tpl", line 7, in block "data_priority"
        {%- for type in output.data | filter_data_type -%}
      File "/usr/local/lib/python2.7/site-packages/nbconvert/filters/datatypefilter.py", line 41, in __call__
        mimetypes=output.keys())
    UndefinedError: 'nbformat.notebooknode.NotebookNode object' has no attribute 'data'

from hide_code.

kirbs- avatar kirbs- commented on May 31, 2024

@lum4chi @leeclemmer would you post the version of Jupyter and notebook your running?

pip list | grep jupyter && pip list | grep notebook should do the trick.

from hide_code.

lum4chi avatar lum4chi commented on May 31, 2024

jupyter (1.0.0)
jupyter-client (4.4.0)
jupyter-console (5.0.0)
jupyter-contrib-core (0.3.0)
jupyter-contrib-nbextensions (0.2.3)
jupyter-core (4.2.1)
jupyter-highlight-selected-word (0.0.7)
jupyter-latex-envs (1.3.6)
jupyter-nbextensions-configurator (0.2.3)
notebook (4.3.1)

from hide_code.

kirbs- avatar kirbs- commented on May 31, 2024

Looks like the 5.0 version of nbconvert changed its API. Until I get this patched you can downgrade nbconvert to 4.3.0 to get hide_code exporting to work.
pip install 'nbconvert==4.3.0' --force-reinstall

Also, what version of nbformat are you using?

from hide_code.

lum4chi avatar lum4chi commented on May 31, 2024

nbformat 4.2.0

from hide_code.

kirbs- avatar kirbs- commented on May 31, 2024

@lum4chi I think this is resolved with nbconvert 5.1.1. Would you upgrade and see if the issue is resolved on your end?

from hide_code.

lum4chi avatar lum4chi commented on May 31, 2024

Hello, I can't confirmed because I've upgraded again some other packages and now hide_code toolbar nor buttons show up and another installation of the plugin cause no effect ^^'. I'm sure have some misconfiguration made by me and need time to investigate.
I'm hoping for nbextension integration :D

from hide_code.

kirbs- avatar kirbs- commented on May 31, 2024

@lum4chi @leeclemmer this is fixed now in the dev branch if you want to test it out. I'll push the update to pypi in a couple of days.

from hide_code.

kirbs- avatar kirbs- commented on May 31, 2024

This is fixed in version 0.5.0.

from hide_code.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.