Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nbconvert hide_code_html doesn't work #33

Closed
jykim opened this issue Feb 10, 2017 · 15 comments
Closed

nbconvert hide_code_html doesn't work #33

jykim opened this issue Feb 10, 2017 · 15 comments
Milestone

Comments

@jykim
Copy link

jykim commented Feb 10, 2017

I get these warnings and the resulting file still shows the code.

Any suggestions?

$ jupyter nbconvert --to hide_code_html --execute ./MDT\ -\ prod.ipynb
[NbConvertApp] WARNING | Config option template_path not recognized by HideCodeHTMLExporter. Did you mean one of: template_extension, template_file?
[NbConvertApp] Converting notebook ./MDT - prod.ipynb to hide_code_html
[NbConvertApp] Executing notebook with kernel: python3
[NbConvertApp] Writing 336217 bytes to ./MDT - prod.html
$

@kirbs-
Copy link
Owner

kirbs- commented Feb 10, 2017

What version of nbconvert are you using?

@jykim
Copy link
Author

jykim commented Feb 10, 2017 via email

@kirbs-
Copy link
Owner

kirbs- commented Feb 10, 2017

I haven't been able to replicate this issue. Do you have any custom configurations you're running?

@jykim
Copy link
Author

jykim commented Feb 11, 2017 via email

@kirbs-
Copy link
Owner

kirbs- commented Feb 12, 2017

The only thing I can think of is maybe a bad/corrupted install. The error message you posted indicates template_path is not recoginized. Check your HideCodeHTMLExporter class, you should see the template_path property defined there.

@kirbs-
Copy link
Owner

kirbs- commented Feb 26, 2017

Would you test with version 0.4?

@chansonZ
Copy link

chansonZ commented Jul 6, 2017

same issue

Python 2.7.13 :: Anaconda 4.4.0 (64-bit)

pip install hide_code
Collecting hide_code
Downloading hide_code-0.4.0.tar.gz
....

$ jupyter nbconvert --to hide_code_html xxxx.ipynb

[NbConvertApp] WARNING | Config option template_path not recognized by HideCodeHTMLExporter. Did you mean one of: template_extension, template_file?
Traceback (most recent call last):
File "/opt/anaconda2/bin/jupyter-nbconvert", line 11, in
sys.exit(main())
File "/opt/anaconda2/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/opt/anaconda2/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/opt/anaconda2/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 293, in start
self.convert_notebooks()
File "/opt/anaconda2/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 447, in convert_notebooks
self.exporter = cls(config=self.config)
File "/opt/anaconda2/lib/python2.7/site-packages/hide_code/hide_code_html_exporter.py", line 12, in init
super(HideCodeHTMLExporter, self).init(config, **kw)
File "/opt/anaconda2/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 153, in init
super(TemplateExporter, self).init(config=config, **kw)
File "/opt/anaconda2/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 101, in init
self._init_preprocessors()
File "/opt/anaconda2/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 250, in _init_preprocessors
self.register_preprocessor(preprocessor, enabled=True)
File "/opt/anaconda2/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 211, in register_preprocessor
preprocessor_cls = import_item(preprocessor)
File "/opt/anaconda2/lib/python2.7/site-packages/ipython_genutils/importstring.py", line 31, in import_item
module = import(package, fromlist=[obj])
TypeError: Item in ``from list'' must be str, not unicode

@kirbs-
Copy link
Owner

kirbs- commented Jul 10, 2017

What version of nbconvert are you using?

@chansonZ
Copy link

5.2.1
[root@localhost test]# jupyter nbconvert --version
5.2.1

@kirbs-
Copy link
Owner

kirbs- commented Jul 12, 2017

Checkout #26. This is due to a change in nbconvert 5.0. Downgrade the package and hide_code should work.
pip install 'nbconvert==4.3.0' --force-reinstall

@kirbs-
Copy link
Owner

kirbs- commented Jul 12, 2017

Also check out jupyter/nbconvert#362.

@kirbs- kirbs- added this to the 0.5.0 milestone Sep 20, 2017
@kirbs-
Copy link
Owner

kirbs- commented Oct 2, 2017

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

@kirbs-
Copy link
Owner

kirbs- commented Oct 7, 2017

This is fixed in version 0.5.0.

@kirbs- kirbs- closed this as completed Oct 7, 2017
@AlfaimaSB
Copy link

Hello,
I am using nbconvert > 5.0, notebook >5.0 ver and the problem still persists. I get the:
[NbConvertApp] WARNING | Config option template_path not recognized by HideCodeHTMLExporter. Did you mean one of: template_extension, template_file?
[NbConvertApp] Converting notebook C:\Users\alfai\Desktop\xxxxxx.ipynb to hide_code_html
[NbConvertApp] Writing 464887 bytes to C:\Users\alfai\Desktop\xxxxxxx.html

@klBio
Copy link

klBio commented Jan 31, 2019

I have the issue as well with

jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-contrib-core 0.3.3
jupyter-contrib-nbextensions 0.5.1
jupyter-core 4.4.0
jupyter-highlight-selected-word 0.2.0
jupyter-latex-envs 1.4.4
jupyter-nbextensions-configurator 0.4.1
jupyterlab 0.35.3
jupyterlab-server 0.2.0
notebook 5.7.4
nbconvert 5.4.0

I get the
WARNING | Config option template_path not recognized by HideCodeHTMLExporter. Did you mean one of: template_extension, template_file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants