Associate ipynb files with Jupyter laptop in Windows 10 (Anaconda)

I installed Anaconda 5.0.1 on my Windows 10 machine. I have several Jupyter laptops on my computer and I would like to associate them with Jupyter so as not to open Jupyter and go to the laptop folders every time. Is it possible?

PS I asked here because I decided that this question will be more interesting for programmers, but if you think that it will be more suitable for SuperUser, I will mark it for migration.

+16
source share
5 answers

Install nbopen : https://github.com/takluyver/nbopen

 pip install nbopen python -m nbopen.install_win 

Now you can double-click the *.ipynb files:

Example.ipynb icon in Windows 7

+23
source

associate .ipnyb with jupyter-notebook.exe

In Windows 10: control panel / programs / programs by default / associate a file type or protocol with a program / select default applications by file type

Look at the list of extensions, find ".ipnyb". Click on the icon and find the jupyter notebook program. In my Anaconda installation, it is located in Anaconda / scripts / jupyter-notebook.exe

+9
source

The easiest way for me is to double-click on the .ipnyb file. When prompted to select a program to open the extension, go to / ProgramData / Anaconda3 / Scripts, find the jupyter-notebook.exe file and click on it.

NOTE. To access the ProgramData folder, you need to view hidden folders in Windows Explorer or access it by typing% programdata% in the navigation bar:

enter image description here

+2
source

If you have Jupyter installed with Anaconda, you can do the following.

Create a small batch file (e.g. start_jupyter_notebook.bat) with the contents (commands from the Jupyter shortcut):

 @echo off set ANACONDAPATH=C:\_work\_programs\Anaconda3 %ANACONDAPATH%\python.exe %ANACONDAPATH%\cwp.py %ANACONDAPATH%^ %ANACONDAPATH%\python.exe %ANACONDAPATH%\Scripts\jupyter-notebook-script.py %1 

(of course, you will have to modify ANACONDAPATH for your installation)

Then go to one .ipynb file of your choice, right-click on it, go to properties → open with → change and select the created batch file.

I am pretty sure that this can also be configured for any other Python / Jupyter installation.

PS The cwp.py file sets some environment variables. I think this is the reason that fredm73's answer did not work for everyone. Also, my answer is very similar at the end.

+2
source

Locate the jupter-notebook.exe file in the C: \ Users \ my_username \ Anaconda3 \ Scripts folder. Copy the address. When you open the .ipnyb file, double-click (if this is the first time) or simply open it, and there you can select the option "always use this" in the menu and find the notebook from the "search for more programs" option in the menu. ,

0
source

Source: https://habr.com/ru/post/1273325/


All Articles