I recently started using Jupyter Notebooks on vscode but i've notices that code autocompletion doesn't work properly.
If i create a regular .py file everything works correctly as you can see. It shows function signature and docstring. In both core python language and extern modules.
But if i try the same in a .ipynb file it completely ignores autocompletion for print()
And what confuses me too if that for example it shows me np.sum() docstring but it doesn't show me any np.concatenate() information gamong any other np.functions or other modules
[
Just in case im using Vscode and an conda enviroment as my python interpreter. Here is my settings.json file:
{
"python.dataScience.jupyterServerURI": "local",
"python.pythonPath": "C:\\Users\\myUser\\anaconda3\\envs\\myEnv\\python.exe"
}
According to your description, the reason for this situation is that different language services provide different functions such as automatic completion and prompts.
For the "print()
" and "np.concatenate()
" you mentioned, it is recommended that you use the "Pylance" extension, which provides excellent language services and auto-complete functions.
Please add the following settings in settings.json
:
"python.languageServer": "Pylance",
Update:
Starting from November 2020, the function of Jupyter notebook in VSCode is provided by the extension "Jupyter", which uses the "IntelliSense" provided by the extension "Jupyter". And in "VSCode-insider" Jupyter notebook has better "IntelliSense":
Github link: Hover Documentation Pop up does not work after VSCode 1.52 update.
This has helped in my case, simply add to settings.json
the following:
For Windows
"python.autoComplete.extraPaths": [
"C:\\Users\\<user_name>\\AppData\\Local\\Programs\\Python\\Python38\\python.exe"
],
For Linux
"python.autoComplete.extraPaths": [
"/usr/bin/python3"
],
For more information:
https://code.visualstudio.com/docs/python/editing
For other tips, visit:
https://code.visualstudio.com/docs/python/jupyter-support
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With