vscode-jupyter: Run Cell does not find Jupyter in virtual environment

Environment data

  • VS Code version: 1.29.1
  • Extension version (available under the Extensions sidebar): 2018.11.0
  • OS and version: MacOSX 10.14.1
  • Python version (& distribution if applicable, e.g. Anaconda): homebrew python 3.7.1
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): pipenv
  • Relevant/affected Python packages and their versions: jupyter notebooks

Actual behavior

Notification with the message: Running cells requires Jupyter notebooks to be installed.

I am able to start jupyter notebook in my virtual environment. screen shot 2018-12-03 at 3 32 46 pm

Expected behavior

Jupyter Notebook being started.

Steps to reproduce:

  1. Create a jupyter python file
  2. Click the Run Cell

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Microsoft Python Language Server version 0.1.65.0
Initializing for /Users/.../.local/share/virtualenvs/jupyter_vscode-_1tZN8jX/bin/python

Linter 'flake8' is not installed. Please install it or select another linter".
Error: Module 'flake8' not installed.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

In the console of the Developper Tools I see that the plug-in is looking for Jupyter in a bunch of my pyenv Python but not my virtualenv.

screen shot 2018-12-03 at 3 43 50 pm

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 4
  • Comments: 30 (15 by maintainers)

Commits related to this issue

Most upvoted comments

We need to ‘activate’ the virtual env prior to running jupyter. Right now we’re just using the same python.

The other jupyters running is us searching for one that will work. We don’t actually need the same environment to start jupyter, we just need to point it at the correct one (see jupyter kernel specs).

Although now that we know we need to activate it, this will likely change too, as I doubt Jupyter/iPython activates the virtual environment before using it.

Okay thanks. That helps. Looks like virtual pipenvs aren’t supported yet then.