al-folio icon indicating copy to clipboard operation
al-folio copied to clipboard

Jupyter notebook dark mode doesn't work on first load

Open george-gca opened this issue 1 year ago • 28 comments

Acknowledge the following

  • [x] I carefully read and followed the Getting Started guide.
  • [x] I read through FAQ and searched through the past issues, none of which addressed my issue.
  • [x] The issue I am raising is a potential bug in al-folio and not just a usage question.
    [For usage questions, please post in the Discussions instead of raising an issue.]

Describe the bug When first opening the blog post about jupyter notebooks, activating the dark mode doesn't affect the notebook. After a reload it works as expected.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://alshedivat.github.io/al-folio/blog/2023/jupyter-notebook/
  2. Change theme to dark and back
  3. Reload the page
  4. Change theme to dark and back again

george-gca avatar Jul 08 '23 21:07 george-gca

Same issue: I try the start jekyll with this command: bundle exec jekyll serve --lsi

I get this error:

....
Jekyll Feed: Generating feed for posts
Populating LSI... 
Rebuilding index... 
                  
 Jekyll Diagrams: Command Not Found: mmdc
Conversion error: JekyllJupyterNotebook::Converter encountered an error while converting 'assets/jupyter/blog.ipynb':
                  No such file or directory - jupyter
                  ------------------------------------------------
    Jekyll 4.3.2   Please append `--trace` to the `serve` command 
                   for any additional information or backtrace. 
                  ------------------------------------------------
/Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-jupyter-notebook-0.0.5/lib/jekyll-jupyter-notebook/converter.rb:50:in `spawn': No such file or directory - jupyter (Errno::ENOENT)
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-jupyter-notebook-0.0.5/lib/jekyll-jupyter-notebook/converter.rb:50:in `block in convert_notebook'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-jupyter-notebook-0.0.5/lib/jekyll-jupyter-notebook/converter.rb:49:in `pipe'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-jupyter-notebook-0.0.5/lib/jekyll-jupyter-notebook/converter.rb:49:in `convert_notebook'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-jupyter-notebook-0.0.5/lib/jekyll-jupyter-notebook/converter.rb:28:in `convert'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:105:in `block in convert'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:104:in `each'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:104:in `reduce'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:104:in `convert'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:84:in `render_document'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:63:in `run'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/site.rb:572:in `render_regenerated'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/site.rb:564:in `block in render_pages'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/site.rb:563:in `each'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/site.rb:563:in `render_pages'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/site.rb:211:in `render'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/site.rb:80:in `process'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/command.rb:28:in `process_site'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:65:in `build'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:36:in `process'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in `each'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/gems/jekyll-4.3.2/exe/jekyll:15:in `<top (required)>'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/bin/jekyll:25:in `load'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/bin/jekyll:25:in `<main>'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/bin/ruby_executable_hooks:22:in `eval'
      from /Users/redabenh/.rvm/gems/ruby-3.1.3/bin/ruby_executable_hooks:22:in `<main>'

There is any workarround ? i'm on Mac OS

RedaBenh avatar Jul 15 '23 18:07 RedaBenh

I finally build jekyll on docker i think you need to complet the section local-setup-standard of getting started guide to include jupyter installation steps

RedaBenh avatar Jul 15 '23 18:07 RedaBenh

Actually the error you reported is not related to this. As you already figured it out, you were just missing jupyter installed on your machine. We have a PR #1523 to make Docker the recommended way of using this, but I agree that jupyter installation is missing in README. I will add it now.

george-gca avatar Jul 15 '23 18:07 george-gca

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 13 '23 22:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 22 '23 23:11 stale[bot]

I couldn't reproduce this bug anymore. Maybe it is solved now.

george-gca avatar Nov 23 '23 16:11 george-gca

I'm getting this but after I push my code to Github Pages in the build step.

  Jekyll Diagrams: Command Not Found: mmdc
  Conversion error: JekyllJupyterNotebook::Converter encountered an error while converting 'assets/jupyter/blog.ipynb':
                    No such file or directory - jupyter
                    ------------------------------------------------
      Jekyll 4.3.2   Please append `--trace` to the `build` command 
                     for any additional information or backtrace. 

Is there something I'm missing?

lesterbotello avatar Dec 10 '23 13:12 lesterbotello

Update on my issue: I was able to fix this by adding the missing Mermaid CLI and Jupyter to the jekyll.yml file:

      - name: Install Node.js for Mermaid CLI
        uses: actions/setup-node@v3
        with:
          node-version: "14"

      - name: Install Mermaid CLI
        run: npm install -g @mermaid-js/mermaid-cli

      - name: Install Python for Jupyter
        uses: actions/setup-python@v4
        with:
          python-version: "3.9"

      - name: Install Jupyter
        run: pip install jupyter

lesterbotello avatar Dec 10 '23 14:12 lesterbotello

Update on my issue: I was able to fix this by adding the missing Mermaid CLI and Jupyter to the jekyll.yml file:

      - name: Install Node.js for Mermaid CLI
        uses: actions/setup-node@v3
        with:
          node-version: "14"

      - name: Install Mermaid CLI
        run: npm install -g @mermaid-js/mermaid-cli

      - name: Install Python for Jupyter
        uses: actions/setup-python@v4
        with:
          python-version: "3.9"

      - name: Install Jupyter
        run: pip install jupyter

Can't fix after adding those lines to yml :(

roilhi avatar Jan 03 '24 06:01 roilhi

Where is the jekyll.yml file you are using? Is it for hosting in another provider? Also what is your error @roilhi?

This issue specifically is related to jupyter dark mode, but a lot of people used it to report a different bug.

george-gca avatar Jan 03 '24 16:01 george-gca

Where is the jekyll.yml file you are using? Is it for hosting in another provider? Also what is your error @roilhi?

This issue specifically is related to jupyter dark mode, but a lot of people used it to report a different bug.

Hello @george-gca, my jekyll.yml file is located at .github/workflows/ directory. I'm using github pages. Everything is fine at local by running the docker compose file. I have the same issue as @lesterbotello, github pages is not building the Jekyll file because of the jupyter notebook issue.

roilhi avatar Jan 03 '24 16:01 roilhi

I believe you are using a very old version of the template, since currently there is no file named jekyll.yml in .github/workflows/.

You probably have to update your code to get these changes, since the current building script does install jupyter.

george-gca avatar Jan 03 '24 17:01 george-gca

@george-gca Thanks. I don't think is an old version, since I have the same deploy.yml file that you show. I will try to update.

roilhi avatar Jan 03 '24 17:01 roilhi

Is that action that is currently running to deploy your site?

george-gca avatar Jan 03 '24 17:01 george-gca

Yes, it is. I've deleted the jekyll.yml file. It´s working but the theme is not renderizing.

roilhi avatar Jan 03 '24 21:01 roilhi

What do you mean?

george-gca avatar Jan 03 '24 23:01 george-gca

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 06 '24 21:03 stale[bot]

I believe you are using a very old version of the template, since currently there is no file named jekyll.yml in .github/workflows/.

You probably have to update your code to get these changes, since the current building script does install jupyter.

If it does install jupyter then what is the cause of error, as I am facing the same error

fareedqk avatar Apr 14 '24 17:04 fareedqk

@george-gca I am facing this error: Conversion error: JekyllJupyterNotebook::Converter encountered an error while converting 'assets/jupyter/blog.ipynb': No such file or directory - jupyter ------------------------------------------------ Jekyll 4.3.3 Please append --trace to the build command for any additional information or backtrace. ------------------------------------------------

What could be the problem?

fareedqk avatar Apr 14 '24 20:04 fareedqk

A lot of comments here deviated from the original issue. The issue here is about dark mode not working on the first load. Other issues must be discussed in their respective issues (or discussions) on the repository.

@fareedqk check the comment above about related problems. If it doesn't solve your problem, please open a new issue for this matter.

george-gca avatar Apr 15 '24 01:04 george-gca

Can confirm the error below still exists even after jupyter installation. This error doesn't pop in some environments / machines, not clear yet why.

  Conversion error: JekyllJupyterNotebook::Converter encountered an error while converting 'assets/jupyter/blog.ipynb':
                    No such file or directory - jupyter
                    ------------------------------------------------
      Jekyll 4.3.3   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------

JacobSuWang avatar May 12 '24 12:05 JacobSuWang

Conversion error: JekyllJupyterNotebook::Converter encountered an error while converting 'assets/jupyter/blog.ipynb': I finally build jekyll on docker

This is the solution that worked for me. Thanks. The old workflow is no longer supported it seems.

JacobSuWang avatar May 12 '24 12:05 JacobSuWang

So is there a solution? I copied the most recent version of alshedivat.github.io today (June 2024), followed the instructions and hit this error. If the solution is to "build Jekyll on Docker" then please explain what that means and how to do it. Since it was mentioned above that the error may occur or not occur depending on the platform, I will mention that, locally, I am working on Ubuntu 20.04. It is the deployment on GitHub that keeps failing.

lvanveen avatar Jun 10 '24 23:06 lvanveen

If your error is not related to jupyter notebook dark mode not working, please open a new issue or Q&A to keep this focused on the error in question.

george-gca avatar Jun 11 '24 01:06 george-gca

The problem is related to your system path. In my case, I installed Jupyter through pip, and the installer put the exec on ~/.local/bin/. This folder wasn't on my path, so Jekyll did not find it when it required it. I just put this folder in the path and solved the problem.

DaniloBorquez avatar Aug 08 '24 14:08 DaniloBorquez