question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter Notebook cells running out of order

See original GitHub issue

Steps to cause the bug to occur

  1. Create a Jupyter Notebook with multiple cells
  2. Click run all cells or any command that runs multiple cells

Actual behavior

Occasionally, cells run out of order, or they are not waiting for execution to finish before the next cell is run. For example, I’ll run import pandas as pd and the next cell will run before pd is set.

Expected behavior

Cells should run in the correct order. Execution on one cell should complete before the next cell starts.

This does not occur in Jupyter Lab when I run it in a browser window. Only in VS Code.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Juan-132commented, Feb 18, 2020

If you hold shift and press enter frequently /rapidly. It will not skip any cells, or execute them out of order

1reaction
Juan-132commented, Feb 17, 2020

I have had this issue as well using run all cells. Executing all cells using shift enter works as expected

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Notebook cells running out of order #2316 - GitHub
Occasionally, cells run out of order, or they are not waiting for execution to finish before the next cell is run. For example,...
Read more >
Execution order of jupyter notebook cells - Stack Overflow
In a jupyter notebook you can run any cell in any order. If you want a clean run - just Kernel -> Restart...
Read more >
Is there an extension that prohibits out-of-order cell execution?
Is there a way to constrain users to linear, top-to-bottom cell execution? Such a tool should allow users to append cells and to...
Read more >
Change priority of cell execution in jupyter notebook?
I want to execute two cells: Cell 1 takes on the order of 10 minutes or hours. Cell 2 will take 1 second....
Read more >
An Introduction to Using Jupyter Notebooks
First: Running Code ... You can run a selected cell by hitting Shift+Enter or clicking the Run ▷-Button in the toolbar. To signal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found