vscode-jupyter
vscode-jupyter copied to clipboard
python extension can't convert .ipynb to .py
I downloaded a vscode before, then I downloaded anaconda. And I found anaconda is very useful, especially jupyter, so I want to combine its function with vscode.
I have tried to operate jupyternotebook to the vscode for a long time, but it doesn't work even once. I'm very upset, so I came here for professional help. I have to admit that I am a novice in this area, here is the specific situation.
OS:windows 10 the latest version of vscode and anaconda with jupyter
the situation is that I can't open a ipynb file in the format of py (with run cell icon, etc.) when I click "import jupyter notebook to python code", it doesn't give a respond.
Then I try to use the #%% to create a test file, but when I click the run cell button, there comes an error report shows "Executing code failed : Error: Activating Python 3.7.3 64-bit ('base': conda) to run Jupyter failed with Error: StdErr from ShellExec, ϵͳ�Ҳ���ָ����·���� ."
I am desperately helpless, and I will appreciate your help!
I used to get what I want on the laptop in my house, I first downloaded anaconda and installed vs code. That doesn't have any problems. So I wondered what's wrong with my laptop at school?
@RayChen6. Sorry that you are hitting this issue. Looks like there is some issue with getting your conda environment on that machine. I'm pretty sure that same issue would be causing both problems that you note (the ipynb conversion and "run cell"). Conda environments can be a bit tricky with activation at times.
The first thing to check would be to see if you can activate your base conda environment from the command line (outside of the VSCode IDE). If you installed anaconda on windows in the start menu there should be an Anaconda Prompt program that you can run. If you run that does it open up a new command window with "(base) C:<some path here>" before the command line?
Another thing that you could try quick would be to manually set the conda path for your project. If you open the VSCode settings there is a Python->Conda path setting. You could try setting that path to your Anaconda install, which might help.
Just ping me back if there is any info on if either of those works for you.
I am so amazing you reply to me so quick!
About the first advice that you gave me, I can't open up an Anaconda Prompt program directly with the remark. It first showed me, "The system could not find the specified path." and then show "(base)..." I can't solve this problem.

As for the second thing you mentioned, I followed your advice and manually set the conda path, "D:\Anaconda3_conda.exe". I wonder if this format is correct. Regretfully, there is still the same error.

Looking forward to your reply!
@RayChen6. Thanks for the info. This could be a bit tricky to debug due to the failure with the Anaconda prompt. What we are seeing there is that something is wrong with your Anaconda install (the specified path issue) and that install is not something that we control from VSCode. If your Anaconda prompt doesn't work correctly then Anaconda + VSCode is also not going to work.
I'm not an expert on Anaconda install issues so you might be better off looking / asking on Anaconda forums, but I think that an easy first step might just to remove Anaconda from your system and try a new install. I do see some similar issues being mentioned online by other users: https://stackoverflow.com/questions/55192853/anaconda-returns-error-the-system-cannot-find-the-file-specified https://stackoverflow.com/questions/55057291/the-system-cannot-find-the-path-specified-in-anaconda-command-prompt https://stackoverflow.com/questions/44597662/conda-command-is-not-recognized-on-windows-10
Looks like you might not have your PATH set correctly? I think that is supposed to be done as part of the Anaconda install steps, but maybe something went wrong with that in your install.
OK, thank you all the way. Actually, I have uninstalled my Anaconda several times. Perhaps I should give up trying, until one day's luck.
I'm reproing this right now using VS Code 1.61-insiders and the latest Jupyter insiders extension.
More specifically, I chose: File->Convert Notebook to Python Script and I get an export error:
> ~\AppData\Local\Programs\PythonCodingPack\python.exe -m jupyter nbconvert --version
Info 2021-09-21 13:34:57: Process Execution: > ~\AppData\Local\Programs\PythonCodingPack\python.exe -m jupyter nbconvert --version
> ~\AppData\Local\Programs\PythonCodingPack\python.exe -m jupyter nbconvert --version
Error 2021-09-21 13:34:58: Export failed Error: Importing notebooks requires Jupyter nbconvert to be installed.
at g.importFromFile (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:52:972930)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at s.export (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:52:922146)
at b.exportToFormat (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:52:919661)
at b.performExport (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:52:918846)
at b.export (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:52:918360)
at c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:90:268958
at u.waitWithStatus (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:90:232715)
at k.importNotebookOnFile (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:90:268881)
at k.listenForErrors (c:\Users\jimg\.vscode-insiders\extensions\ms-toolsai.jupyter-2021.9.1001256920\out\client\extension.js:90:264660)
at a._executeContributedCommand (c:\Users\jimg\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:112416)
latest issue is just dealing with exporting a notebook, not Interactive window
@RayChen6 Are you still running into this issue I've test this with the latest bits and it works as expected./ If this issue still exists, please feel free to comment here and we'll re-open this issue or feel free to create a new issue