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.
Expected behavior
Jupyter Notebook being started.
Steps to reproduce:
- Create a jupyter python file
- Click the Run Cell
Logs
Output for Python
in the Output
panel (View
→Output
, 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.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 30 (15 by maintainers)
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.