42

Within Jupyter Notebook in VS Code when I run code that prints a lot of output at some point the remaining output is suppressed and a message is displayed

"show more (open the raw output data in a text editor) ..."

How can I make all the output visible?

enter image description here

Matt
  • 7,004
  • 11
  • 71
  • 117
  • 1
    I think that's internally done and is not possible. https://stackoverflow.com/questions/36786722/how-to-display-full-output-in-jupyter-not-only-last-result does this help –  Jun 06 '21 at 03:27
  • When you calculate really big numbers in IDLE, it compresses the data and asks user to display full output. I think that's done to prevent IDLE from becoming unresponsive –  Jun 06 '21 at 03:29
  • @Sujay, I will check out that link, but at first sight that is not what I am referring to. I mean I explicitly use the "print()" command and such print outs are done multiple times and upon reaching a certain number rows only the last content is shown. Similar to training neutal networks with tensorflow in jupyter, after a certain number Epochs, only the last one is shown. There seems to be a setting to limit the total number rows/pixels that are shown when outputting anything in jupyter... – Matt Jun 06 '21 at 03:31
  • @Sujay, I am happy to "open the raw output data in a text editor" but how can I do that. Clicking on the info message makes VS Code crash – Matt Jun 06 '21 at 03:33
  • 1
    ```from IPython.core.interactiveshell import InteractiveShell``` ```InteractiveShell.ast_node_interactivity = "all"``` does this help –  Jun 06 '21 at 03:36
  • @Sujay, again, this above tip only helps with outputting data directly, such as putting "a" into a line, given a is previously defined. But it does not affect when explicitly printing via "print()". After a certain number of rows the remainder is cut, and the info message is displayed: "show more (open the raw output data in a text editor)" – Matt Jun 06 '21 at 03:37

4 Answers4

71

I think you are using the insiders build here is the right setting ,I had the same problem and it worked for me.

"notebook.output.textLineLimit": 500

edit: this will also work for the stable version

Atmani Saad
  • 819
  • 5
  • 8
  • 31
    Just to add to this. Open VS Code > File > Preferences > Settings. Then in the settings page look for "notebook". Scroll down and there's the "Notebook > Output: Text Line Limit", which by default has value 50 but can be increased. (VS Code 1.59.0) – João Pedro 'jota' Martins Aug 07 '21 at 12:44
  • 2
    I had to add this to my workspace text file like `"settings": { "notebook.output.textLineLimit": 500 } ` – imbr Aug 30 '21 at 12:51
  • 3
    worked for me after restarting vs code – Philipp Steiner Sep 15 '22 at 10:19
9

You need to change it from the settings. This is set lower value (30 in my case). To see all lines, you need to change the "number of lines to show" value. Follow these steps to do so.

Open VS code settings or (ctrl + ,) >> In search box type "output.textLineLimit" >> Find "Notebook>Output: Text Line Limit" >> Change the value as per your requirement (say 500 to show 500 lines)

Raushan Kumar
  • 121
  • 1
  • 2
1

In the latest version of VS Code, the above-mentioned options can be found under Features->Notebook->Output: Text Line Limit

user6347318
  • 11
  • 1
  • 1
  • 3
-3

set

"jupyter.textOutputLimit": 0

in the settings.json.

The default value of it is 20000.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13