Giter Club home page Giter Club logo

Comments (25)

andreagrandi avatar andreagrandi commented on July 18, 2024 1

Thanks for your quick reply Daniel!
I've done a tiny PR to pin the version #127
I'm not sure if you are still available to merge and release it by the way.
In case you think you are not able to maintain this anymore, would it be possible to become maintainer for the PYPI package here https://pypi.org/project/pelican-jupyter/ ? This way I could keep developing and fixing the package on my own repository but this would not disrupt future releases.
Cheers

from pelican-jupyter.

flothesof avatar flothesof commented on July 18, 2024 1

I believe I have the same problem: rendering of notebooks have suddenly failed when my automated build updated to the latest version.

Using the built-in option for specifying a template, I managed to find a workaround.

LIQUID_CONFIGS = (("IPYNB_EXPORT_TEMPLATE", "base", ""),)

If my reasoning is correct, the template called "basic" has been renamed to "base" by nbconvert, which causes the trouble of the notebooks not rendering anymore.

I therefore conclude that changing this line might solve this problem:

template_file = "basic"

Judging by bug reports over at nbconvert, it seems that quite a lot of template-related things have been broken by release 6.0:

jupyter/nbconvert#1451 (comment)

from pelican-jupyter.

shanewilkins avatar shanewilkins commented on July 18, 2024 1

@flothesof This seems to have done the trick for me. All of the plotly plots in my notebooks have disappeared, but that's a separate issue.

from pelican-jupyter.

andreagrandi avatar andreagrandi commented on July 18, 2024

I did a few more tests and there seems to be an incompatibility with nbconvert >= 6.

I had accidentally upgraded that package and the plugin couldn't work anymore.

As soon as I installed back the latest 5.x available, the plugin worked (with Pelican 4.5.0).

I think we should pin the version in requirements to be >=5,<6 (or whatever the syntax is, I don't remember it by memory).

This as a short term fix of course. For the long term it would be interesting to understand what changed in 6.x

Cheers

from pelican-jupyter.

danielfrg avatar danielfrg commented on July 18, 2024

Thanks for the report @andreagrandi a lot of packages are broken right now because of nbconvert 6.0.0, so yeah we should totally pin this.

I am personally not using this plugin anymore so I wont be working on this in the near future. If you want to take look at it please do so.

from pelican-jupyter.

andreagrandi avatar andreagrandi commented on July 18, 2024

Actually I'm struggling to make my PR work, since there are a few isort problems which are failing on CI but I can't reproduce on my local machine, so don't bother yet.

from pelican-jupyter.

danielfrg avatar danielfrg commented on July 18, 2024

@andreagrandi thanks for the offer, i am happy to add you as maintainer here and on PyPI! I will do it on GitHub now. Let me know your PyPI username and I will also add you there.

isort recently broke the CI linting on some of my projects, I personally just removed that from the CI as its not critical but up to you to just disable it.

from pelican-jupyter.

andreagrandi avatar andreagrandi commented on July 18, 2024

I'm andreagrandi on PyPI too.

About isort: where did you remove it from exactly? It seems that it's still running when I push the code, that's why the build is failing. I will try to use exactly the same version (or pin its version to the same I use locally), because I haven't been able to reproduce the same problem locally on my machine.

from pelican-jupyter.

danielfrg avatar danielfrg commented on July 18, 2024

Added you to pypi.

I removed it from the github actions until i see why are they failing.

from pelican-jupyter.

dclong avatar dclong commented on July 18, 2024

@danielfrg Are you using another better alternative or do you simply give up using Jupyter for Pelican?

from pelican-jupyter.

danielfrg avatar danielfrg commented on July 18, 2024

I am no longer using pelican for any websites. I use mkdocs for docs so I wrote: https://github.com/danielfrg/mkdocs-jupyter
And for my website I just use hugo and a similar script.

from pelican-jupyter.

shanewilkins avatar shanewilkins commented on July 18, 2024

Confirm that the upgrade to nbconvert 6.0 is the issue. I downgraded back to 5.6 and the error went away. I haven't been able to test whether @flothesof 's fix will work.

from pelican-jupyter.

johnmathews avatar johnmathews commented on July 18, 2024

As well as downgrading nbconvert to 5.6.0, I also needed to downgrade notebook to 5.6.0. The suggestion from @flothesof didn't make any difference for me.

from pelican-jupyter.

flothesof avatar flothesof commented on July 18, 2024

@johnmathews prompted by your finding I tried again and was able to replicate my workaround from (almost) scratch.
Version info:

  • ipython 7.11.1
  • notebook 6.1.5
  • pelican 4.5.3
  • jupyter 1.0.0
  • jupyter-client 6.1.7
  • jupyter-console 6.2.0
  • jupyter-core 4.6.1
  • jupyterlab-pygments 0.1.2
  • pelican-jupyter 0.10.0
  • nbconvert 6.0.7

Here's what I had to put into my pelicanconf.py (only relevant lines included):

from pelican_jupyter import liquid as nb_liquid # import pelican-jupyter
...
PLUGINS = ['liquid_tags.img', nb_liquid, 'representative_image']
...
# configuring notebook integration
LIQUID_CONFIGS = (("IPYNB_FIX_CSS", "False", ""), 
                  ("IPYNB_SKIP_CSS", "False", ""), 
                  ("IPYNB_EXPORT_TEMPLATE", "base", ""),)

Maybe this works better for you?

from pelican-jupyter.

AndreasThinks avatar AndreasThinks commented on July 18, 2024

Glad I'm not the only one! It looks like it's an issue pulling out the Jinja2 template or similar...May have to explore alternative solutions to good Python/Jupyter static pages! Have been pondering swapping to Hugo for awhile, may be the time to make the jump.

from pelican-jupyter.

alex000kim avatar alex000kim commented on July 18, 2024

downgrading to python 3.6, nbconvert=5.6.0, notebook=5.6.0 helps, but then plotly plots stop rendering...

from pelican-jupyter.

davidwagner avatar davidwagner commented on July 18, 2024

Changing basic.tpl to classic/base.html.j2 in plugins/ipynb/core.py seems to also fix this, without needing to downgrade nbconvert. I have a somewhat older version of pelican-jupyter though so this might need to be translated to the latest version.

I wonder if something like

template_file = 'classic/base.html' if int(nbconvert.__version__.partition(".")[0]) >= 6 else 'basic'

might work.

from pelican-jupyter.

canyon289 avatar canyon289 commented on July 18, 2024

Im having this same issue as well. Tagging myself onto the discussion here!

from pelican-jupyter.

magsol avatar magsol commented on July 18, 2024

Can confirm this is still an issue. Here is my relevant environment:

  • ipython 7.29.0
  • notebook 6.4.6
  • pelican 4.6.0
  • jupyter 1.0.0
  • jupyter_client 7.1.0
  • jupyter_console 6.4.0
  • jupyter_core 4.9.1
  • pelican-jupyter 0.10.0
  • pelican-liquid-tags 1.0.1
  • nbconvert 6.3.0

Can also confirm that the fix posted by @flothesof still works, at least in terms of the LIQUID_CONFIGS.

I did have a slight modification I had to make, as it appeared that having both pelican-jupyter and pelican-liquid-tags register the same notebook tag was causing problems: I could either get Jupyter notebooks to render, OR any of the other liquid tags (images, videos, code, etc). So I moved the pelican-jupyter liquid.py file over to the pelican-liquid-tags folder, renamed it notebook.py, and slightly modified the imports.

After this, my pelicanconf.py looked like this:

from pelican.plugins import liquid_tags
PLUGINS = [
        liquid_tags,                # regular ol' liquid tags
]
LIQUID_TAGS = ["img", "include_code", "gram", "video", "youtube", "notebook"]
LIQUID_CONFIGS = (("IPYNB_FIX_CSS", "False", ""), 
                  ("IPYNB_SKIP_CSS", "False", ""), 
                  ("IPYNB_EXPORT_TEMPLATE", "base", ""),)

Seems to work. It's not pretty but I couldn't find a way to have the two plugins co-exist.

from pelican-jupyter.

ozak avatar ozak commented on July 18, 2024

Same error. After following the advice above I am getting the following error

could not find information about 'title'

But I have both the nbdata and ipynb-meta files for each notebook in the same folder as the notebook, and it used to work with previous versions. Any ideas would be appreciated.

from pelican-jupyter.

flothesof avatar flothesof commented on July 18, 2024

from pelican-jupyter.

ozak avatar ozak commented on July 18, 2024

No, it fails completely and does not generate anything. I also get an additional error

CRITICAL UndefinedError: 'gettext' is undefined

which I have no idea what is causing it.

from pelican-jupyter.

flothesof avatar flothesof commented on July 18, 2024

@danielfrg Do you have any ideas how we could get out of this situation that the current version of the plugin is not working as expected anymore? Would you be willing to transfer maintainership to someone else to get the plugin to work with current versions of nbconvert since you don’t seem to have time to work on this?
Regards,
Florian

from pelican-jupyter.

andreagrandi avatar andreagrandi commented on July 18, 2024

@danielfrg Do you have any ideas how we could get out of this situation that the current version of the plugin is not working as expected anymore? Would you be willing to transfer maintainership to someone else to get the plugin to work with current versions of nbconvert since you don’t seem to have time to work on this? Regards, Florian

I also "maintain" (I did a release but stuff in real life happened and couldn't do anymore) the package on PyPI https://pypi.org/project/pelican-jupyter/ but I've no idea how to fix this. Plus I haven't used the library in ages (I haven't since then written anything which requires this package to be working).

from pelican-jupyter.

flothesof avatar flothesof commented on July 18, 2024

@andreagrandi thank you for coming back on this topic
Actually, support for notebooks also works with the liquid-tags plugin and seems to be functional. This could help some people stuck here: https://github.com/pelican-plugins/liquid-tags#ipython-notebooks

from pelican-jupyter.

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.