1

I am running VS Code (Version 1.52) with extensions Jupyter Notebook (2020.12) and Python (2020.12) on MacOS Catalina.

Context:

I have problems getting Intellisense to work properly in my Jupyter Notebooks in VS Code. Some have had some success with adding these config parameters to the global settings of VS Code:

"python.dataScience.runStartupCommands": [
    "%config IPCompleter.greedy=True",
    "%config IPCompleter.use_jedi = False"
]

I went ahead and added those as well but then had to realize that all settings under python.dataScience are Unknown Configuration Setting. Any idea why this is and how I could this get to work?

user190080
  • 525
  • 1
  • 8
  • 29
  • What is the "Intellisense" effect you expect from Jupyter notebook in VSCode? Could you please provide us with a detailed example? – Jill Cheng Dec 21 '20 at 09:21
  • @JillCheng basically I was expecting the same IntelliSense support as in standard Python files ``.py`` and what is also described [here - vscode for jupyter](https://code.visualstudio.com/docs/python/jupyter-support#_intellisense-support-in-the-jupyter-notebook-editor). For example for ``print()`` all I am getting is code completion but no further information whatsoever. I also get no module information. About the python settings I was wondering whether this was deprecated somehow since it seems the extension doesn't support this (not listed). – user190080 Dec 21 '20 at 12:40

2 Answers2

2

Since Nov 2020 the Jupyter extension is seperated from Python extension for VS Code. The setting key has been renamed from python.dataScience to jupyter^update

So in your case please rename python.dataScience.runStartupCommands to jupyter.runStartupCommands

Libin Varghese
  • 1,506
  • 13
  • 19
  • 1
    Thanks! Now the setting is finally recognized...still, the Jupyter doesn't work well with Intellisense, but this seems a different issue altogether. – user190080 Jan 04 '21 at 18:01
1

According to your description, you could refer to the following:

  1. Whether in the ".py" file or the ".ipynb" file, we can use the shortcut key "Ctrl+space" to open the code suggested options:

    enter image description here

  2. It is recommended that you use the extension "Pylance", which provides outstanding language services for Python in VSCode, and related content will also be displayed in the Jupyter file:

    enter image description here

Combine these two methods:

enter image description here

For setting "python.dataScience.runStartupCommands", as it shows "Unknown Configuration Setting", now we don't use it to set Jupyter's "Intellisense" in VSCode.

Jill Cheng
  • 9,179
  • 1
  • 20
  • 25
  • That's interesting. I activated ``Pylance`` and changed the ``Language Server to Pylance``. It is working in standard ``.py`` files, also ``trigger suggest`` works, **but** in ``Jupyter Notebooks .ipnyb`` it just won't work: code completion yes, but no ``trigger suggest`` (not recognized as a command). Everything is working again in ``.py`` with magic commands ``# %%``. – user190080 Dec 22 '20 at 18:28
  • @user190080 -Thank you for sharing the method with us. – Jill Cheng Dec 23 '20 at 04:29
  • sure, you're welcome. Unfortunately, the magic commands approach doesn't really solve the issue - for example, in the Jupyter Notebook, executed cell's output will be displayed right under the cell, which doesn't work with the magic commands. – user190080 Dec 23 '20 at 11:43