Skip to content
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

Python: Import Jupyter Notebook fails with nbconvert is not installed #3797

Closed
AlJohri opened this issue Nov 14, 2018 · 8 comments
Closed

Python: Import Jupyter Notebook fails with nbconvert is not installed #3797

AlJohri opened this issue Nov 14, 2018 · 8 comments
Assignees

Comments

@AlJohri
Copy link

AlJohri commented Nov 14, 2018

Environment data

Pipenv has a cool command for reporting all this information automatically: pipenv --support | pbcopy where the output of this command can be pasted straight into the github issue. You might consider adding something like this for the code CLI tool.

  • VS Code version: 1.29.0
  • Extension version (available under the Extensions sidebar): 2018.10.1
  • OS and version: macOS 10.13.6
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.1
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pipenv
  • Relevant/affected Python packages and their versions: jupyter

Actual behavior

It says converting the notebook to python requires "jupyter nbconvert" to be installed. It is installed within the virtualenv as you can see through the output of pip freeze.

screen shot 2018-11-13 at 9 19 33 pm

Expected behavior

I expect it to convert the notebook.

Steps to reproduce:

  1. XXX

Logs

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

I didn't see anything under Python.

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

console.ts:134 [Extension Host] Python Extension: Error: Error executing Jupyter command 'nbconvert': [Errno 2] No such file or directory

t.log @ console.ts:134
console.ts:134 [Extension Host] Python Extension: Importing notebooks requires Jupyter nbconvert to be installed.
t.log @ console.ts:134
notificationsAlerts.ts:40 Importing notebooks requires Jupyter nbconvert to be installed.
t.onDidNotificationChange @ notificationsAlerts.ts:40
@AlJohri
Copy link
Author

AlJohri commented Nov 14, 2018

Installing globally fixed the issue but it should work from the active python interpreter.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 15, 2018

We run python -m jupyter nbconvert --version to determine if it's there or not. Although this might be related to us picking the wrong jupyter kernelspec. See issue microsoft/vscode-python#3343

@AlJohri
Copy link
Author

AlJohri commented Nov 15, 2018

thanks @rchiodo. Is that global python -m or the active python interpreter?

@rchiodo
Copy link
Contributor

rchiodo commented Nov 15, 2018

The active interpreter.

@AlJohri
Copy link
Author

AlJohri commented Nov 17, 2018

Verified that this only works when I run code . within a virtualenv. Running code . outside causes both the import and the "Run Cell" button to not work properly.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 19, 2018

I think the insiders build should have fixed your problem. I changed the way we load the kernel spec for jupyter.

@rchiodo rchiodo self-assigned this Nov 19, 2018
@akirsman
Copy link

akirsman commented Nov 27, 2018

Fixed by "pip3 install nbconvert" and the restart VS Code

@rchiodo rchiodo closed this as completed Nov 30, 2018
@rchiodo
Copy link
Contributor

rchiodo commented Nov 30, 2018

This should be fixed now in our latest release.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants