1

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?

2 Answers 2

2

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:\Users\XYZ\Anaconda3\Scripts\activate.bat" call conda activate myEnvironment call python C:\Users\XYZ\Anaconda3\Scripts\jupyter-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.

Sign up to request clarification or add additional context in comments.

2 Comments

"Lastly you just need to configure that every .ipynb opens up using your jupyter-notebook.bat script." how would you do that ?
If it's on Windows, I meant by opening the file's properties and changing "Open File WIth" and enter the batch command's path.
0

I solved this by cloning the git repo of nbopen and then running ./osx-make-iconset.sh followed by ./osx-install.sh

I got an error "cp: nbopen/icons/ipynb_icon_1024x1024.png: No such file or directory". Just copy the icon_512x512.png file and rename it as such, it works fine.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.