hplgit / doconce

Lightweight markup language - document once, include anywhere
http://hplgit.github.io/doconce/doc/web/index.html
Other
310 stars 60 forks source link

using --execute: which ipython/jupyter is expected? #139

Closed karinlag closed 6 years ago

karinlag commented 6 years ago

I am working on having doconce execute code to analyze some things. To that end, I created a jupyter notebook which I then converted to do.txt, which I'm then trying to run with doconce. However, I get this error:

karinlag@bl8vbox[notebook_templates] doconce format ipynb fastqc_eval_notebook.do.txt.do.txt --execute
translating doconce text in fastqc_eval_notebook.do.txt.do.txt to ipynb
*** error: cannot do import nbformat.v4 or IPython.nbformat.v4
    make sure IPython notebook or Jupyter is installed correctly
Abort! (add --no_abort on the command line to avoid this abortion)
karinlag@bl8vbox[notebook_templates] 

From this I suspect that doconce is not able to get to the program/version it would like to use to execute the notebook, so my question is: what is it looking for?

mhjensen commented 6 years ago

Hi Karin, you need most likely to upgrade your python version to python3.6 and use the jupiter notebook that follows this version of python. Dot that via pip3 install Jupyter The error you get is a typical one when doconce is not able to find the correct python and Jupyter notebook version. Hope that helps, Morten p.s. an easy way to install all the dependencies is via conda or Enthoughts python IDE. I install everything normally via (on a mac) brew and pip3 for python3 and pip for python2.7

Morten Hjorth-Jensen, Michigan State University, USA and University of Oslo, Norway, http://mhjgit.github.io/info/doc/web/

On Dec 3, 2017, at 9:05 PM, Karin Lagesen notifications@github.com wrote:

I am working on having doconce execute code to analyze some things. To that end, I created a jupyter notebook which I then converted to do.txt, which I'm then trying to run with doconce. However, I get this error:

karinlag@bl8vbox[notebook_templates] doconce format ipynb fastqc_eval_notebook.do.txt.do.txt --execute translating doconce text in fastqc_eval_notebook.do.txt.do.txt to ipynb *** error: cannot do import nbformat.v4 or IPython.nbformat.v4 make sure IPython notebook or Jupyter is installed correctly Abort! (add --no_abort on the command line to avoid this abortion) karinlag@bl8vbox[notebook_templates] From this I suspect that doconce is not able to get to the program/version it would like to use to execute the notebook, so my question is: what is it looking for?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hplgit/doconce/issues/139, or mute the thread https://github.com/notifications/unsubscribe-auth/ACmzmWMW7KHthWRQTlzpWTzfQfZdVguvks5s8v8OgaJpZM4Qz3WV.

KGHustad commented 6 years ago

The error is caused by DocOnce not being able to import nbformat, which is used to generate the ipynb file. Jupyter must be installed in the same Python environment as DocOnce.

I suspect that doconce is not able to get to the program/version it would like to use to execute the notebook

nbformat.v4 refers to version 4 of the Jupyter Notebook file format, and this should be available in all recent versions of Jupyter.

karinlag commented 6 years ago

Ok, so I have installed Jupyter via pip install, so that should be fine, but it is still not working. Is there a?specific command I can try to see if I have available in that shell? That way I might not end up installing everything under the sun to see what will work :)

Also, my python is 3.6.3, so that should also be good.

mhjensen commented 6 years ago

Enter python (python3 if you have that nstalled) mode or just use IPython Mortens-MacBook-Pro:~ hjensen$ IPython Python 3.6.3 (default, Oct 4 2017, 06:09:15) Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details.

In [1]: import jupyter In [3]: print("Jupyter version {}".format(jupyter.version)) Jupyter version 1.0.0

That should do it. Hope it works, Morten

Morten Hjorth-Jensen, Michigan State University, USA and University of Oslo, Norway, http://mhjgit.github.io/info/doc/web/

On Dec 5, 2017, at 9:22 AM, Karin Lagesen notifications@github.com wrote:

Ok, so I have installed Jupyter via pip install, so that should be fine, but it is still not working. Is there a?specific command I can try to see if I have available in that shell? That way I might not end up installing everything under the sun to see what will work :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hplgit/doconce/issues/139#issuecomment-349230119, or mute the thread https://github.com/notifications/unsubscribe-auth/ACmzmRTsIfvCWdVAXsUPJqLHhGUQ6vA_ks5s9P0pgaJpZM4Qz3WV.

karinlag commented 6 years ago

Thanks @mhjensen , will test that out tomorrow, thanks for giving me a method for checking my setup!