Coder Social home page Coder Social logo

Comments (7)

moorepants avatar moorepants commented on May 28, 2024

I'm guessing this traceback I'm getting is due to v4 not being supported:

(plotly-notebooks)moorepants@moorepants-2170p:IPython-plotly(bicycle-control)$ make run nb=bicycle_control
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/moorepants/Jobs/plotly/IPython-plotly/_makescripts/trim.py in <module>()
     35 
     36 if __name__ == "__main__":
---> 37     main()

/home/moorepants/Jobs/plotly/IPython-plotly/_makescripts/trim.py in main()
     21         file_ipynb = path_handler.get_file(arg, '.ipynb')
     22         nb_json = ds.load_json(file_ipynb)
---> 23         cells = path_handler.load_config(arg)['cells']
     24 
     25         if nb_json['nbformat'] == 4:

/home/moorepants/Jobs/plotly/IPython-plotly/_makescripts/common.pyc in load_config(self, arg)
     56     def load_config(self, arg):
     57         path_config = os.path.join(self.get_path(arg), 'config.json')
---> 58         return ds.load_json(path_config)
     59 
     60     def load_references(self):

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/delightfulsoup/io.pyc in load_json(path_json)
     45 
     46     with open(path_json, 'r') as f:
---> 47         return _json.load(f)
     48 
     49 

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/__init__.pyc in load(fp, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    288         parse_float=parse_float, parse_int=parse_int,
    289         parse_constant=parse_constant, object_pairs_hook=object_pairs_hook,
--> 290         **kw)
    291 
    292 

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/__init__.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    336             parse_int is None and parse_float is None and
    337             parse_constant is None and object_pairs_hook is None and not kw):
--> 338         return _default_decoder.decode(s)
    339     if cls is None:
    340         cls = JSONDecoder

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/decoder.pyc in decode(self, s, _w)
    364 
    365         """
--> 366         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    367         end = _w(s, end).end()
    368         if end != len(s):

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/decoder.pyc in raw_decode(self, s, idx)
    380         """
    381         try:
--> 382             obj, end = self.scan_once(s, idx)
    383         except StopIteration:
    384             raise ValueError("No JSON object could be decoded")

ValueError: Expecting property name: line 2 column 63 (char 64)
[NbConvertApp] WARNING | pattern u'bicycle_control.tmp.ipynb' matched no files
Traceback (most recent call last):
  File "/home/moorepants/anaconda/envs/plotly-notebooks/bin/ipython", line 6, in <module>
    sys.exit(start_ipython())
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/__init__.py", line 120, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/config/application.py", line 574, in launch_instance
    app.start()
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 367, in start
    return self.subapp.start()
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/nbconvert/nbconvertapp.py", line 278, in start
    self.convert_notebooks()
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/nbconvert/nbconvertapp.py", line 392, in convert_notebooks
    self.exporter = exporter_map[self.export_format](config=self.config)
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/nbconvert/exporters/templateexporter.py", line 154, in __init__
    self._init_template()
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/nbconvert/exporters/templateexporter.py", line 271, in _init_template
    self._template_file_changed('template_file', self.template_file, self.template_file)
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/nbconvert/exporters/templateexporter.py", line 97, in _template_file_changed
    self._load_template()
  File "/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/IPython/nbconvert/exporters/templateexporter.py", line 167, in _load_template
    from jinja2 import TemplateNotFound
ImportError: No module named jinja2

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

make: *** [run] Error 1

from ipython-plotly.

bllchmbrs avatar bllchmbrs commented on May 28, 2024

You are correct but you can concert it pretty easily. Something like

Ipython nbconvert f1 f2

Google nbconvert and its in the ipython docs

from ipython-plotly.

bllchmbrs avatar bllchmbrs commented on May 28, 2024

Convert*

from ipython-plotly.

moorepants avatar moorepants commented on May 28, 2024

Yes, I know how to use nbcovert. But there is a trim.py in the make run target that does something and that is failing.

from ipython-plotly.

moorepants avatar moorepants commented on May 28, 2024

Once I install jinja2 I get this from make run:

(plotly-notebooks)moorepants@moorepants-2170p:IPython-plotly(bicycle-control)$ make run nb=bicycle_control
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/moorepants/Jobs/plotly/IPython-plotly/_makescripts/trim.py in <module>()
     35 
     36 if __name__ == "__main__":
---> 37     main()

/home/moorepants/Jobs/plotly/IPython-plotly/_makescripts/trim.py in main()
     21         file_ipynb = path_handler.get_file(arg, '.ipynb')
     22         nb_json = ds.load_json(file_ipynb)
---> 23         cells = path_handler.load_config(arg)['cells']
     24 
     25         if nb_json['nbformat'] == 4:

/home/moorepants/Jobs/plotly/IPython-plotly/_makescripts/common.pyc in load_config(self, arg)
     56     def load_config(self, arg):
     57         path_config = os.path.join(self.get_path(arg), 'config.json')
---> 58         return ds.load_json(path_config)
     59 
     60     def load_references(self):

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/site-packages/delightfulsoup/io.pyc in load_json(path_json)
     45 
     46     with open(path_json, 'r') as f:
---> 47         return _json.load(f)
     48 
     49 

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/__init__.pyc in load(fp, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    288         parse_float=parse_float, parse_int=parse_int,
    289         parse_constant=parse_constant, object_pairs_hook=object_pairs_hook,
--> 290         **kw)
    291 
    292 

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/__init__.pyc in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    336             parse_int is None and parse_float is None and
    337             parse_constant is None and object_pairs_hook is None and not kw):
--> 338         return _default_decoder.decode(s)
    339     if cls is None:
    340         cls = JSONDecoder

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/decoder.pyc in decode(self, s, _w)
    364 
    365         """
--> 366         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    367         end = _w(s, end).end()
    368         if end != len(s):

/home/moorepants/anaconda/envs/plotly-notebooks/lib/python2.7/json/decoder.pyc in raw_decode(self, s, idx)
    380         """
    381         try:
--> 382             obj, end = self.scan_once(s, idx)
    383         except StopIteration:
    384             raise ValueError("No JSON object could be decoded")

ValueError: Expecting property name: line 2 column 63 (char 64)
[NbConvertApp] WARNING | pattern u'bicycle_control.tmp.ipynb' matched no files
This application is used to convert notebook files (*.ipynb) to various other
formats.

WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.

Options
-------

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--init
    Initialize profile with default config files.  This is equivalent
    to running `ipython profile create <profile>` prior to startup.
--execute
    Execute the notebook prior to export.
--stdout
    Write notebook output to stdout instead of files.
--debug
    set log level to logging.DEBUG (maximize logging output)
--quiet
    set log level to logging.CRITICAL (minimize logging output)
--inplace
    Run nbconvert in place, overwriting the existing notebook (only 
    relevant when converting to notebook format)
--profile=<Unicode> (BaseIPythonApplication.profile)
    Default: u'default'
    The IPython profile to use.
--reveal-prefix=<Unicode> (RevealHelpPreprocessor.url_prefix)
    Default: 'reveal.js'
    The URL prefix for reveal.js. This can be a a relative URL for a local copy
    of reveal.js, or point to a CDN.
    For speaker notes to work, a local reveal.js prefix must be used.
--ipython-dir=<Unicode> (BaseIPythonApplication.ipython_dir)
    Default: u''
    The name of the IPython directory. This directory is used for logging
    configuration (through profiles), history storage, etc. The default is
    usually $HOME/.ipython. This option can also be specified through the
    environment variable IPYTHONDIR.
--nbformat=<Enum> (NotebookExporter.nbformat_version)
    Default: 4
    Choices: [1, 2, 3, 4]
    The nbformat version to write. Use this to downgrade notebooks.
--writer=<DottedObjectName> (NbConvertApp.writer_class)
    Default: 'FilesWriter'
    Writer class used to write the  results of the conversion
--log-level=<Enum> (Application.log_level)
    Default: 30
    Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
    Set the log level by value or name.
--to=<CaselessStrEnum> (NbConvertApp.export_format)
    Default: 'html'
    Choices: ['custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']
    The export format to be used.
--template=<Unicode> (TemplateExporter.template_file)
    Default: u'default'
    Name of the template file to use
--output=<Unicode> (NbConvertApp.output_base)
    Default: ''
    overwrite base name use for output files. can only be used when converting
    one notebook at a time.
--post=<DottedOrNone> (NbConvertApp.postprocessor_class)
    Default: u''
    PostProcessor class used to write the  results of the conversion
--config=<Unicode> (BaseIPythonApplication.extra_config_file)
    Default: u''
    Path to an extra config file to load.
    If specified, load this config file in addition to any other IPython config.
--profile-dir=<Unicode> (ProfileDir.location)
    Default: u''
    Set the profile location directly. This overrides the logic used by the
    `profile` option.

To see all available configurables, use `--help-all`

Examples
--------

    The simplest way to use nbconvert is

    > ipython nbconvert mynotebook.ipynb

    which will convert mynotebook.ipynb to the default format (probably HTML).

    You can specify the export format with `--to`.
    Options include ['custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']

    > ipython nbconvert --to latex mynotebook.ipynb

    Both HTML and LaTeX support multiple output templates. LaTeX includes
    'base', 'article' and 'report'.  HTML includes 'basic' and 'full'. You
    can specify the flavor of the format used.

    > ipython nbconvert --to html --template basic mynotebook.ipynb

    You can also pipe the output to stdout, rather than a file

    > ipython nbconvert mynotebook.ipynb --stdout

    PDF is generated via latex

    > ipython nbconvert mynotebook.ipynb --to pdf

    You can get (and serve) a Reveal.js-powered slideshow

    > ipython nbconvert myslides.ipynb --to slides --post serve

    Multiple notebooks can be given at the command line in a couple of 
    different ways:

    > ipython nbconvert notebook*.ipynb
    > ipython nbconvert notebook1.ipynb notebook2.ipynb

    or you can specify the notebooks list in a config file, containing::

        c.NbConvertApp.notebooks = ["my_notebook.ipynb"]

    > ipython nbconvert --config mycfg.py

make: *** [run] Error 255

from ipython-plotly.

moorepants avatar moorepants commented on May 28, 2024

What is the goal of make run? I see that it "trims" the file and then runs nbconvert and switches around file names. If you can give me the exact commands you want me to run on the notebook. I'll run them.

from ipython-plotly.

moorepants avatar moorepants commented on May 28, 2024

FYI, the make file does seem to run fine on v4 notebooks when the correct dependencies are installed.

from ipython-plotly.

Related Issues (14)

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.