Home > Software design >  Integrating Python and Jupyter Notebook with Visual Studio Code
Integrating Python and Jupyter Notebook with Visual Studio Code

Time:09-01

Summary:

I am trying to set up the Jupyter Notebook extension for VSCode but I can’t get my Python code snippets to run. There is no "Run" button to select. I can't select a Python/ Jupyter kernel to work with.

The problem in greater detail:

If you check out this YouTube clip at exactly 1 minute and 46 seconds (enter image description here

CodePudding user response:

VS Code has prompted you to install the suggested extension. enter image description here

Also it helps to make sure your vscode is enter image description here

  • new terminal

    enter image description here

  • Type the command python -m venv .venv to create a virtual environment

    enter image description here

  • After the creation is complete, use the command .venv/scripts/activate to activate the virtual environment

    enter image description here

    Or Ctrl Shift P --> Python:Select Interpreter, select the interpreter of the virtual environment and then create a new terminal to activate the environment

    enter image description here

  • Create new jupyter file using command palette command Create:New Jupyter Notebook

    enter image description here

    Or right click --> New File --> name ends with .ipynb

    enter image description here

  • The virtual environment you just selected will be enabled as the kernel by default.

    enter image description here

  • CodePudding user response:

    I discovered a very simple answer: I installed the VSC package in the official Snap repo.

    VSC and Python-Jupyter look to be all playing nice together now:

    enter image description here

    • Related