Why does Jupyter notebook stop executing after a line is re-run after an error?
- Dominant language
- Jupyter Notebook
- Stars
- 13.3k
- Forks
- 5.8k
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 7
Description
For the **Encoding categorical data** section, the first time I ran it, I got an error because I didn't have sklearn installed. After I installed it and re-run, I got **In [*].** No matter how many times I run it, it's not executing. Basically, after an error is made, all lines can't be executed again.

One thing I found out is that this Jupyter Notebook is under tensorflow environment. This is what I did from the beginning:
1. Create tensorflow environment, then install tensorflow
2. Import the libraries, it didn't work because matplotlib not installed
3. Then install matplotlib
From my own troubleshooting, this is where the problem begins. So I tried to uninstall matplotlib, it's fine again as shown.
Now even there's an error, I can still re-run it and the execution is fine because the number will be updated instead of [*].
Then the problem arises again because if I keep running it, it will turn into [*] again after maybe 3rd or 4th times. The thing is if I do the same thing with Jupyter notebook under root environment(no tensorflow installed, matplotlib is installed), I can keep re-running it for as many times and there's no problem(the number will be changed). So what's wrong with it?
Contributor guide
Research direction
Begin with the Encoding categorical data section and reproduce repeated execution after the initial missing-dependency errors. Compare the tensorflow and root environments described in the report, and document the dependency and environment conditions that cause execution to remain at In [*] along with a verified resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, matplotlib, scikit-learn, tensorflow
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100