Skip to content

"Run Cell" does not pickup on jupyter installed via virtualenv but conda works #3801

@sotte

Description

@sotte

Environment data

  • VS Code version: 1.29.0 5f24c93878bd4bc645a4a17c620e2487b11005f9 x64

  • Extension version (available under the Extensions sidebar): 2018.10.1

  • OS and version: Ubuntu 18.04

  • Python version (& distribution if applicable, e.g. Anaconda): pipenv with python 3.7

  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv

  • Relevant/affected Python packages and their versions: -

Actual behavior

When using a virtualenv/pipenv environment clicking on "Run Cell" yields the error msg:
Running cells requires Jupyter notebooks to be installed.

(But it works with conda.)

Expected behavior

Cell is executed.

Steps to reproduce:

mkdir hello
cd hello
pipenv --python 3.7
pipenv shell
pipenv install jupyter
which jupyter
# /home/somebody/.local/share/virtualenvs/hello-UXM3mEkX/bin/jupyter
# jupyter notebook also works on its own

Open vscode, select the interpreter for the "hello" pipenv environment, create a file demo.py with the following content:

#%%
print("hello")

Clicking on "Run Cell" yields the error msg:
Running cells requires Jupyter notebooks to be installed.

Relevant excerpt from Pipfile.lock

        "jupyter-client": {
            "version": "==5.2.3"
        },
        "jupyter-console": {
            "version": "==6.0.0"
        },
        "jupyter-core": {
            "version": "==4.4.0"
        },

Logs

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

No output.

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

/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Python Extension: Error: Error executing Jupyter command 'nbconvert': [Errno 2] No such file or directory

t.log @ /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:294
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:294 [Extension Host] Python Extension: Error: Running cells requires Jupyter notebooks to be installed.
t.log @ /usr/share/code/resources/app/out/vs/workbench/workbench.main.js:294
/usr/share/code/resources/app/out/vs/workbench/workbench.main.js:2429 Running cells requires Jupyter notebooks to be installed.

nbconvert is not available via the venv, but jupyter-nbconvert is.

Maybe Related

See https://github.com/Microsoft/vscode-python/issues/3341 and https://github.com/Microsoft/vscode-python/issues/3332

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions