Open .ipynb in Anaconda Jupyter Notebook on double-click (macOS)

Question:

I’ve been trying to figure out how I can open a .ipynb file on double-click on a Mac, so the file opens with Anaconda and then automatically opens Jupyter Notebook with the file contents.

I have tried creating an application through Automator that opens with a jupyter_lab command, but the issue is that Jupyter lives in Anaconda, so this method is not working. See these articles for my steps: https://samedwardes.com/2020-01-31-open-ipynb-with-double-click/ and Open an ipython notebook via double-click on osx

I have also tried installing nbopen with the following:

python3 -m pip install nbopen

This works, and then I can run nbopen file.ipynb through the terminal, but I want to be able to bypass this step and do it while in file explorer, physically looking at the file instead.

I have ran the recommended command for osx to integrate it with file manager ./osx-install.sh but I just get zsh no such file or directory and can’t really find any help with figuring out why this is pushing back an error.

Any suggestions?

Asked By: Madison Leopold

||

Answers:

I have this "convenience issue" as well, and didn’t go for the nbopen route, but instead, I just made a batch script (I named it jupyter-notebook.bat) that calls certain conda functions, and pretty much initiates things like how double clicking works. In the script, I just have this:

call "C:UsersXYZAnaconda3Scriptsactivate.bat"
call conda activate myEnvironment
call python C:UsersXYZAnaconda3Scriptsjupyter-notebook-script.py %1

Lastly you just need to configure that every .ipynb opens up using your jupyter-notebook.bat script.

For consistency, I placed the script in my Anaconda folder. And if you also have nb_conda_kernels installed in your base environment, you’d have access to the other environment you’ve created as well from there.

Answered By: Adji_PA

Just install the pineapple and be happy:

https://nwhitehead.github.io/pineapple/

enter image description here

enter image description here

Answered By: Jalles10