"Run Cell" does not pickup on jupyter installed via virtualenv but conda works
See original GitHub issueEnvironment 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 (View
→Output
, 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
Update: It seem to be related to how you start vscode.
code .
then “run cell” works.jupyter
is not available in the currentPATH
)conda and virtualenv seem to be handled differently. Is this a bug or accepted behavior?
@rchiodo Yes, works as expected when starting code with environment activated in terminal. Not using pipenv though (as in microsoft/vscode-jupyter#3774). If I understand correctly, pipenv uses VirtualEnv, while pyenv-virtualenv uses native
python3 -m venv
despite its name