Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open ipynb files into browser by double-click

Previously, I had Canopy installed and at that time, I could simply double click on ipynb files and open them into the browser. However, later I needed Anaconda and once I installed it, this feature was gone. Now I just want to be able to simply double click on ipynb files and the file gets open into the Firefox. Is it possible?

I read about this: nbopen

pip install nbopen
python -m nbopen.install_win

But it didn't solve my problem. I appreciate any help.

like image 485
user3709260 Avatar asked Apr 21 '17 04:04

user3709260


2 Answers

Yes, this is possible. Running python -m nbopen.install_win installs the executable nbopen.exe in the Scripts folder of your anaconda directory. For me this is:

PS> (gcm nbopen).Path
E:\Programs\anaconda\Scripts\nbopen.exe

The first line gets the path of the nbopen command (using PowerShell). If you are not using PowerShell you can find your conda directory by right-clicking on any (I)Python executable in your start menu and look at where it links to.

You can then associate the nbopen.exe file with the .ipynb filetype:

  1. Right-click on a .ipynb file.
  2. Click on Properties
  3. Click on the Change button next to "Open With:"
  4. Click on Browse, browse to the path you found out and select nbopen.exe.

Double-clicking on .ipynb files now checks if a notebook server is running and opens the notebook. If no server is running, one is started in the active directory.

like image 194
m00am Avatar answered Oct 21 '22 08:10

m00am


Checkout this Firefox plugin. Python Notebook Viewer.

This plugin lets you view/render python notebooks without running notebook server. Once installed, set Firefox as default app to open ipynb files. From now onwards, you can simply open ipynb files by simply double clicking on it!

This saves a lot of time as most of the time developers are just keen on seeing a code. It also saves a hassle of browsing directories in Jupyter Notebook window to reach to a specific file.

like image 39
Manojk07 Avatar answered Oct 21 '22 08:10

Manojk07