takluyver / nbopen

Open a Jupyter notebook in the best available server
BSD 3-Clause "New" or "Revised" License
301 stars 58 forks source link

Double-clicking .ipynb file does not work with nbopen #75

Closed mramadhito closed 3 years ago

mramadhito commented 3 years ago

Hi,

Any time I open an .ipynb file after I set the default app to open with as nbopen.exe, this error in the command prompt is produced. How can I troubleshoot this?

image

Thanks, Garda

takluyver commented 3 years ago

Does it show that message and open anyway, or is it also not working? That message is a warning, not an error, so it's not necessarily a problem.

The install_win.py script sets it up to open with pythonw.exe -m nbopen rather than nbopen.exe - that should prevent a console window appearing.

mramadhito commented 3 years ago

So upon recording the command prompt again there is indeed an error message for a split second.

image

I ran the script above and it didn't change anything -- there's still an error and .ipynb files wouldn't open by double-clicking them. It looks like I'm missing a module from the error.

takluyver commented 3 years ago

Other people have been having similar errors to that - take a look at #61 and #69.

mramadhito commented 3 years ago

I re-installed both Anaconda and Python and I followed the instructions in #69. It looks like jupyter notebook needs to be activated before the double-click works.

Greedquest commented 3 years ago

@mramadhito have you tried what I suggested; change the registry key at

Computer\HKEY_CURRENT_USER\SOFTWARE\Classes\Jupyter.nbopen\shell\open\command

to

C:\Users\{USERNAME}\anaconda3\python.exe -m conda run -n base pythonw -m nbopen "%1"

(use whichever path to python the registry key currently references (i.e. switch USERNAME to your own))

mramadhito commented 3 years ago

That works @Greedquest ! Thank you so much!

Greedquest commented 3 years ago

@mramadhito great, I hoped it would! Maybe leave a thumbs up or something on the original thread so people know in future: https://github.com/takluyver/nbopen/issues/69#issuecomment-751688215

I should say the conda run command is in beta atm so may break, but I just wanted to solve the problem now! Also a terminal window may flash but it's fine to close it if it stays open, I asked about a fix over on SO here