New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Run Cell" does not pickup on jupyter installed via virtualenv but conda works #3801
Comments
Update: It seem to be related to how you start vscode.
conda and virtualenv seem to be handled differently. Is this a bug or accepted behavior? |
I have the same setup as @sotte except I am on MacOS Mojave 10.14.1. But, event if I start vscode within the environment started by Pipenv, vscode is not able to find Jupyter. The Jupyter Python Package from @DonJayamanne is able to find the Jupyter executable. |
@rchiodo thanks for the quick reply! I just checked |
@sotte Ah, your venv doesn't support nbconvert so you can't do an import. There's a bug in the code that it checks for nbconvert instead of notebook being available. This line here: That line should say: Sorry took me so long to notice you didn't have nbconvert installed in your venv. I'll submit a fix for this right away. |
Should be fixed now in microsoft/vscode-python@d2a5e21 |
@rchiodo thanks, you're great! |
@sotte Were you able to take advantage of the fix? I have very similar issue (macOS 10.14.1) and I've been navigating the related issues that've been merged, but can't make out if the fix is available |
Yes, it worked for me. The fix is only available through the nightly/insider build though @leonjonathan |
Thanks @sotte, no luck for me though. Looks like the commit with the fix has already been pushed to Extension Version 2018.11.0, which is what I am using. After looking at #3774 it's worth mentioning that I'm on python 3.6.7 (pyenv install) and my virtual environment is created with venv (via pyenv-virtualenv), so maybe worth opening my own issue? @rchiodo |
@leonjonathan if you're using a pip venv then #3774 is likely the culprit. If you start code from the terminal that has the environment activated, does it work then? |
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:
Open vscode, select the interpreter for the "hello" pipenv environment, create a file
demo.py
with the following content:Clicking on "Run Cell" yields the error msg:
Running cells requires Jupyter notebooks to be installed.
Relevant excerpt from Pipfile.lock
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)No output.
Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)nbconvert
is not available via the venv, butjupyter-nbconvert
is.Maybe Related
See https://github.com/Microsoft/vscode-python/issues/3341 and https://github.com/Microsoft/vscode-python/issues/3332
The text was updated successfully, but these errors were encountered: