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

Nothing happens when clicking "Open as Jupyter Notebook" #9

Open
robin-norconsult opened this issue Jan 17, 2022 · 11 comments
Open

Nothing happens when clicking "Open as Jupyter Notebook" #9

robin-norconsult opened this issue Jan 17, 2022 · 11 comments

Comments

@robin-norconsult
Copy link

I have been using this extension successfully on an ubuntu environment before, but now on my windows environment the extension doesn't work.
The option "Open as Jupyter Notebook" is available, but doesnt respond at all. No error message, just nothing.
I am currently working on insider-1.64.0

@paw-lu
Copy link

paw-lu commented Jan 25, 2022

this is happening to me recently too (macOS)

@paw-lu
Copy link

paw-lu commented Jan 25, 2022

actually right after commenting on this issue I realized that if I create a brand new blank file it's openable.

@JamesHuckle
Copy link

JamesHuckle commented Feb 12, 2022

Problem
Same problem for me too, it works fine the first time on a new .py but as soon as you save the cloned .ipynb and it makes the changes to the .py, you are then unable to "Open as a Jupyter Notebook" on that same .py file again (no error to be seen, just nothing)

Emotional damage
It's a travesty because this will be game-changing when it works because it's convenient (runs on every save) and eliminates the need for having both cloned .ipynb and .py files.

Temporary solution
I have resorted to adding and manually running this command in a cell:
os.system(f'jupytext --to py:percent my_notebook.ipynb')

It is from the standard jupytext library and when ran it clones the .ipynb as a new interactive ("# %%" syntax) .py file.

I commit the cloned .py files into source control and then convert them back into their .ipynb counterparts if pulling fresh from the repo. I put this at top of every .ipynb I want to convert into a .py and vice-versa. Run it each time you want to save.

file_name = 'test'
if f'{file_name}.ipynb' not in os.listdir():  
   print('Save .py file as .ipynb because no such file already exists.')            
   os.system(f'jupytext --to notebook {file_name}.py')
else:
   print('Save .ipynb file as .py with interactive syntax') 
   os.system(f'jupytext --to py:percent {file_name}.ipynb')```

@dynobo
Copy link

dynobo commented Feb 18, 2022

Having the same issue.

A workaround that works for me: If a file won't open, I perform "Open as Jupyter Notebook" on a different file. When I then try it again on the original file, that one opens correctly now, too.

The bug makes this otherwise very useful extension cumbersome to use, hoping for a fix, too :-)

@agftrading
Copy link

Having similar issues, except not found a workaround even that works yet. Such a shame since when it was working it was awesome.

@Marigold
Copy link

@agftrading try this extension instead of the original one, it fixed the issue for me

@DonJayamanne
Copy link
Member

DonJayamanne commented Jun 20, 2022

I'm sorry for the inconvenience caused & apologies for the radio silence.

The reason this extension went stale is because of the hacks i implemented in this extension to ensure it worked well with the other Juptyer extnesion & VS Code (without using proposed API).

however I have some good news, this will be fixed soon, by moving this functionality into https://github.com/microsoft/vscode-jupyter-powertoys
That way the support will be better as it will be more tightly integrated with the Jupyer externsion & we'll have the benefit of being able to use the API provided by VS Code which hasn't been published yet - i.e. no more work arounds/hacks.

That being said, please note the fact that this is purely experimental, the purpose & dev of power toys is outlined here https://github.com/microsoft/vscode-jupyter-powertoys

...
Features may be added or removed at any time and there is no guarantee of future support by virtue of inclusion in the extension now. Features in this extension that see high usage may be considered for removal from this extension and inclusion in the main Jupyter VS Code extension. In that case, best efforts will be made to notify of the change and migrate settings if possible.
...

@DonJayamanne
Copy link
Member

Will update this issue and this repo soon

@mjspeck
Copy link

mjspeck commented Aug 31, 2023

Having the same issue.

A workaround that works for me: If a file won't open, I perform "Open as Jupyter Notebook" on a different file. When I then try it again on the original file, that one opens correctly now, too.

The bug makes this otherwise very useful extension cumbersome to use, hoping for a fix, too :-)

I can't believe this worked, but it did. Thanks for finding this hacky workaround!

@ener-jay
Copy link

ener-jay commented Mar 19, 2024

@DonJayamanne thanks for the super useful extension. Any updates on this issue? "Open as Jupyter Notebook" works the first time, but not after you close the notebook and try again. I get the same issue with congyiwu's version. I am using the official vscode (not insiders edition). Is it supported by powertoys now?

@paw-lu
Copy link

paw-lu commented Mar 19, 2024

For people on this thread, check out the fork congyiwu/vscode-jupytext! At least on my machine, works as expected! (Huge thanks to the fork author!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants