Can I disable or suppress warnings about jupyter not being installed by the Jupyter vscode extension? - visual-studio-code

I'd like to use the Python extension for VSCode,
but it depends on the Jupyter extension (see Q&A here).
I don't use Jupyter on most of my projects and therefore is not installed in my virtual environment.
This causes the Jupyter extension to keep popping up a warning which cannot be dismissed
that it "Failed to start a session" (because Jupyter is not installed).
Is there a setting in the extension that I have overlooked to suppress this warning?

Could you try turning the setting Jupyter->Disable Jupyter Auto Start to true? We have code that tries to autostart a jupyter server or kernel (if you used it before) early. Turning this off should suppress the prompt.

File > Preferences > Settings
Now expand "Text Editor"
"Suggestions"
"Edit in Settings.json"
Now you can disable all notifications or only for an extension.

Related

VS Code cannot breakpoint or step through 3rd party Python code from Jupyter Notebook

One of my main uses for a debugger is to step through parts of new libraries to better understand how they work and how to use them. But, my current install of VS Code refuses to let me set breakpoints or step through 3rd party libraries when I start debugging in Jupyter Notebook. I get a 'Breakpoint in file excluded by filters' error.
I've looked through everything I could find online about this problem, and nothing I've tried has worked. I have:
In File > Preferences > Settings > Debug turned on 'Allow breakpoints everywhere' for both User and Workspace
In ... Settings > Extensions > Jupyter turned off 'Debug Just My Code' for both
In launch.json changed ' "justMyCode": true ' to ' "justMyCode": false '
After suggestions in How to disable "just my code" setting in VSCode debugger?, I tried to add a separate debug configuration to launch.json. This used to do the trick, but ' "request": "test" ' can no longer be used. Various alternatives I've tried here also do not work (e.g. "request": "attach" or "purpose": "debug-test").
The problem does not exist when I use a python file with the same code. So whatever is applying filters is only doing so when I seek to debug a cell in Jupyter Notebook.
For others, the issue has been resolved, see release notes: "Just My Code" for notebook cell debugging.
"Just My Code" for notebook cell debugging
The "Just My Code" debug feature allows the user to determine whether
the debugger will step through code from Python libraries, or will
only step through user code. This has been enabled by default when
debugging a notebook cell, and you can now set
"jupyter.debugJustMyCode": false to disable it and allow stepping
through library code. For the best experience, upgrade debugpy in
your environment to >=1.6.3. Previously, this setting was only
respected for debugging using the Interactive Window. Now it is
respected in notebook editors as well.
Evidently, the problem I'm encountering is a known bug: https://github.com/microsoft/vscode-jupyter/issues/8146 . I've heard from a VS Code developer that they've (tried) to implement fixes and I should try the latest Insiders vscode build, with the latest pre-release Jupyter extension. I'm not sure I'm ready for bleeding edge, so may live with the bug until these fixes end up in a standard release.

VS Code: jupyter notebook run line by line

Recently VSCode got an update and after that my jupyter notebook interface has changed which created a lot of problems for me. Now I don't know how to run cell code line by line, etc.
Is there any other way to do so or how can I get back to an older version of the notebook?
Open the command palette (Ctrl+Shift+P on Windows, Cmd+Shift+P on Mac)
Type 'Preferences: Open Settings (JSON)' and select the first option to open your user settings.json file
Add the following line to your user settings.json file:
"jupyter.experiments.optOutFrom": ["NativeNotebookEditor"],
If the following entry is present in your user settings.json file, delete it:
"workbench.editorAssociations": [
{
"viewType": "jupyter-notebook",
"filenamePattern": "*.ipynb"
}
]
Reload Visual Studio Code for the new settings to take effect. You should be opted back into the old Jupyter notebook interface.
If you want to run a python script line by line using Jupyter interpreter this is the option you need to tick in VS code settings.
In v1.60 (see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_60.md#jupyter):
VS Code now supports the Run By Line feature in Jupyter notebooks.
This is a simple debug mode that lets you execute the code of a cell
line by line. To try it out, just make sure that you have ipykernel v6+ installed as your selected kernel, then select the Run By Line
button.
Previously:
In vscode 1.59 (see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_59.md#jupyter-run-by-line)
Jupyter "Run By Line"
We've been working on supporting the "Run By Line" feature in Jupyter
notebooks. This feature is essentially a simplified debug mode that
lets you step through your cell's code line by line without any
complex debug UI. This is still experimental, but you can try it out
by setting "jupyter.experimental.debugging": true, installing
version 6 of ipykernel in your selected kernel, then clicking the "Run
By Line" button in the cell toolbar.
"jupyter.experimental.debugging": true

how to disable jupyter editor in vscode

like the title mentioned, how to disable jupyter editor in vscode?
every time,I want to new a file just for text or markdown,I do not like to appear a choice between two, but just default for the inner editor applied by vscode. and how can I configure this.
for right now,I never need to use jupyter notebook.
It seems to be appeared unexpected after vscode update or installed some python package.
This can be disabled by python.dataScience.useNotebookEditor if you are using the Python extension.
Source: https://github.com/microsoft/vscode/issues/103526
Update:
You also need the Jupyter extension along with Python extension for VS Code. The setting key has been renamed from python.dataScience.useNotebookEditor to jupyter.useNotebookEditor^update
With the July/August 2021 introduction of the new Native Notebook Support in VS Code, the answers involving your settings.json are now obsolete. Now the Notebook editor will be used to open .*ipynb files even if you've never installed the Python or Jupyter extensions.
However, you can open a *.ipynb file in the regular text editor by right-clicking on the file in the VS Code File Explorer, doing "Open With", and then selecting the "Text Editor".

Highlight typos in the jupyter notebook markdown

When I write something in the jupyter notebook markdown field, the typos are not highlighted and often I ended up with something like this:
In almost all IDEs I have used so far, the typos are highlighted with a curly underline which was very convenient for me. Something like this:
Up till now I have not found anything that allows me to see this type of highlights. Does it exist?
The popular Jupyter Notebook bundle extension from Jupyter-contrib contains a spell checker. You can install and enable this (with admin privileges) like so:
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable spellchecker/main
This may be the most popular spell checker for Jupyter Notebooks, but note that it simply highlights words not in its dictionary, and does not offer corrections.
If the extension installed properly, you will see this message in the command line:
Now, in the browser, after opening Jupyter, you will see the button labelled "abc" beside the keyboard button, which you can toggle to enable/disable spell check:
The jupyter-contrib library has many other useful modules such as code folding and table of contents.
Run the following in a terminal:
ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip
ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip
ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-cell-tools-1.0.zip
jupyter nbextension enable calico-spell-check
You can see typos like
Find out more
Afterwards, you need to activate the spell check in the Jupyter Notebook:
%%javascript
IPython.notebook.config.update({
"load_extensions": {"calico-spell-check":true,
"calico-document-tools":true,
"calico-cell-tools":true
}
})
The spellchecker and some other extensions from jupyter_contrib_nbextensions is incompatible with the ipython version 5.8.0. and later. (Found that it works in some cases for the version 5.0.0 [refer issue page of the same]. I'm not aware of its compatibility for the ipython versions between 5.0.0. to 5.8.0., please do comment if anyone knows).
The calico's nbextension 'spellchecker' available at https://bitbucket.org/ipre/calico/downloads/calico-spell-check-1.0.zip is an outdated version [dated 2015]. But calico had updated their nbextensions and made avaliable at the github repository [latest dated 2018]. It works fine for the ipython version 5.8.0.
Installation
git clone https://github.com/Calysto/notebook-extensions.git
cd notebook-extensions
jupyter nbextension install calysto --user
jupyter nbextension enable calysto/spell-check/main
Check its status:
jupyter nbextension list
When you now open or reload a notebook, there would be a new button visible with a check mark icon next to the button to open the command palette. You may click on it to check the spelling mistakes in the markdown cell.

Stop ipython pop-up docs

In the ipython qtconsole it automatically displays the documentation for a function when I type the opening parenthesis. For example, when I'm typing
plt.show()
the documentation for pyplot.show is displayed when I've typed
plt.show(
This documentation is displayed in a pop-up window that, much more often than not, blocks my view what I'm typing. Is there a configuration to stop the ipython qtconsole from doing this?
The feature to which you refer is calltips or more precisely IPythonWidget.enable_calltips and is documented at https://ipython.org/ipython-doc/dev/config/options/qtconsole.html. The only effective way I have found to disable it is by adding --IPythonWidget.enable_calltips=False as an argument to qtconsole that in turn an argument of ipython. A command line for all of this is:
ipython qtconsole --IPythonWidget.enable_calltips=False
I have verified this with IPython QTConsole 3.2.0 and believe it generally works for versions below 4, which I have not been able to install yet without breaking QTConsole. (I believe what some refer to as IPython 4 is also known as Jupyter 4. See below for information on Jupyter and disabling calltips in it.)
On Linux and Windows system, generating this command line can be automated using a bash alias. On Windows it can be automated by using it as the Target of an icon configured in its properties.
It is supposed to be possible to disable calltips by setting c.IPythonWidget.enable_calltips = False in the right configuraton file in which c = get_config() is set on the first line. I tried doing this on a Windows 7 system in ipython_qtconsole_config.py and ipython_config.py in ~.ipython\profile_default\ and several other locations, but could not get it to work.
Project Jupyter is the successor to the IPython project and began in 2014. Its website is http://jupyter.org and information about its Qt console is at http://jupyter.org/qtconsole/stable/index.html. In response to a question about disabling IPython calltips, which I submitted to https://github.com/ipython/ipython/issues, I received the following on how to disable calltips for Jupyter:
On the command line
jupyter qtconsole --JupyterWidget.enable_calltips=False
or add
c.JupyterWidget.enable_calltips = False
to
~/.jupyter/juptyer_qtconsole_config.py