0

Today, while running a Python script in Jupyter Notebook launched from Anaconda Navigator, the run was aborted and I received an alert stating "IOPub data rate exceeded". I tried to implement some of the solutions given here and elsewhere on SO, but have run into various issues:

1) One suggestion is to create a <jupyter_notebook_config.py> file through the command line:

$ jupyter notebook --generate-config

This creates the file in <C:\Users\msfea.jupyter>. I am then supposed to comment out the existing

c.NotebookApp.iopub_data_rate_limit = 1000000

and replace it with

c.NotebookApp.iopub_data_rate_limit = 10000000

The problem is that when I open the file (in Thonny), the entire script of ~1300 lines is already commented out. Uncommenting everything doesn’t work, and practically I can’t go through it line by line. I just cannot figure out what the starting appearance of the script should be, much less modify it.

2) Another suggestion is to run

jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e10

from Anaconda Navigator's command line. This automatically opens a new instance of Jupyter Notebook in my browser and if I run my script in this new instance of Jupyter, it works! Problem is, it's not permanent. If I close everything down and then relaunch Anaconda Navigator and Jupyter Notebook, my script once again fails with the same error message, "IOPub data rate exceeded". While I suppose I could live with this, it's really not ideal and should be surmountable. If only I knew how!

Thanks for your help.

1 Answers1

0

OK, I figured it out based on a different understanding of what was meant here. Note, I am using a PC running Windows 11. For anyone interested, follow these steps. Just to make clear, I use the version of Jupyter Notebook launched from within Anaconda Navigator. I cannot be certain that the steps below would work on other platforms.

  1. At the command line (I launched the terminal from within Anaconda Navigator -- no idea whether that's important), type or paste the following text: jupyter notebook --generate-config

This creates the python file jupyter_notebook_config.py in the .jupyter folder found here: C:\Users\your_handle\.jupyter

  1. Open the file in an IDE (I used Thonny). You will see that the entirety of the script is commented out (meaning there is a # before every line). Use the "Find" function to search for this text: c.NotebookApp.iopub_data_rate_limit = 1000000

  2. Uncomment this line by deleting the # that starts the line. It will change from greyed out to typical text.

  3. Add one zero to the end of the value 1000000, thereby increase the data rate limit from one million to ten million bytes/sec. (No idea whether one could or should go higher. I have seen warnings about setting the data rate limit too high.)

  4. Save.

  5. I then closed all programs/applications, shut down the pc and then re-started. No idea whether this was necessary.

Hope this helps someone.