question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Cell does not find Jupyter in virtual environment

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rchiodocommented, Jan 11, 2019

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.

1reaction
rchiodocommented, Dec 4, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run Cell does not find Jupyter in virtual environment #3774
Notification with the message: Running cells requires Jupyter notebooks to be installed. I am able to start jupyter notebook in my virtual environment....
Read more >
What to do when things go wrong - The Jupyter Notebook
If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command...
Read more >
Jupyter Notebook in virtual environment doesn't see the virtual ...
the solution is to open jupyter notebook with following command: ~/virtualenv/my_venv_name/bin/jupyter-notebook.
Read more >
How to Install Virtual Environments in Jupyter Notebook on Mac
Open Terminal : The Terminal is an emulator that's used in Jupyter Notebook to access the file system of the server from the...
Read more >
Using Jupyter Notebook in Virtual Environments for Python ...
Jupyter notebooks are an interactive environment where you can write and execute Python code, as well as add markdown cells to explain your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found