I am missing something basic, I'm sure. If I have a jupyter notebook at a url like this https://github.com/nicolaskruchten/pyconca/blob/master/jupyter_magic.ipynb, how can I view it as an interactive notebook that I can then edit?
You can load it from a few places online and of course offline. The easiest way to get this loaded offline is downloading Python + Jupyter and that can be found in one place. Download and install Anaconda (2.7 or 3.4) from http://continuum.io/downloads and depending on your OS,
If you run mac or linux restart a terminal and run "ipython notebook" which will open a browser to navigate you to the right location (your downloads folder) to find the .ipynb file
if you run Windows there is an icon in the applications menu to start "Ipython notebook" which will open a browser to navigate you to the right location (your downloads folder) to find the .ipynb file
Online there is a site called http://Wakari.io/ (requires an account) from which you can share the result with others.
Related
I've been searching for a way to open jupyter notebooks by double clicking on .ipynb files in Windows explorer, and I've installed nbopen since visiting this stackoverflow answer.
Jupyter notebooks run fine on my computer, and I can open a server if I navigate to the correct folder in anaconda prompt and type for instance jupyter notebook or nbopen file.ipynb.
However, when double clicking on .ipynb files (or "open with" nbopen.exe) I get the error messages displayed in the screenshot below. Apologies for the lack of a text version - the window disappears very quickly and I've only captured this by means of well-timed screenshot taking (incidentally, any tips on how to capture short-lived error messages like this in future would be appreciated). After the window has disappeared, nothing further happens
To try to resolve the error I have reinstalled nbopen but no success. I have also tried opening the .ipynb files with jupyter-notebook.exe, which duplicates this error message after from notebook import notebookapp.
The default python version (i.e. the first result for python --version) on my PC is Python 3.8.5.
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?
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.
This is a bit hard to explain so bear with me! Suppose I have a Jupyter notebook in some directory. The only way I know to open it is to click repeatedly through the web based directory structure. Is there a nice way to do this using the mac finder. In other words I would like a simple dialogue box to open from Jupyter to navigate to my notebook.
edit: thanks, I realized that I can start in certain directories, but what if I'm opening a bunch of different notebooks from different directories. It sure would be nice to be able to jump to my favorites easily.
As #GiantsLoveDeathMetal mentions... if you navigate to a specific directory in your terminal and then type jupyter notebook the notebook will open and display in your browser, just the content of that folder.
For example:
$ cd /path/to/the/folder/with/your/notebook.ipynb
$ jupyter notebook
I am an anaconda user and Jupyter is a neat tool to run python code. However, for my macbook, I can't open it in Chrome (This page isn’t working
localhost didn’t send any data.),but it works in Safari, I have tried to reinstall chrome, but I still can't fix it. My system is Mac OS 10.11.5.
Who knows how I can fix it?
I can understand that the problem might be not specific enough, but I have been puzzled by this problem for quite a period of time.
There was a similar problem in the git page for Jupyter:
https://github.com/jupyter/notebook/issues/2438
Try going to directly to http://localhost:8888/tree
or whatever port you are using.
Download jupyter notebook from link below
Download jupyter notebook
Once you downloaded it, run it any browser it will work
Just copy paste the link with token from the terminal to chrome.
It should work after that.
The steps are :
Cd to directory u want to go to
Type jupyter notebook , a browser window opens up after this command.
If safari opens up copy paste the link from safari to chrome.
It might ask u for a token the first time. That can found in the terminal where jupyter command is typed.
Related posts: Open an ipython notebook via double-click on osx
How can I open Ipython notebook from double click? I always cd to the directory of the notebook, then type ipython notebook in the browser and then open it in the browser. This steps is very inconvenient.
In windows, I remembered that I can change the directory in the browser, but in linux there is no way to explore to other directory via browser, if I want to open a new book in another directory, I have to restart another kernel as above, which annoys me.
Is there any simple and verified way to do this?
You can use a project like nbopen that handle that and will open the browser on the right notebook + start an IPython server if one is not yet running.
pip install nbopen.
open Automator, create new Application
Drag'n drop Run Shell Script
Change Pass input to as arguments
Copy/paste this script:
variable="'$1'"
the_script='tell application "terminal" to do script "nbopen '
osascript -e "${the_script}${variable}\""
Save the new application to Applications directory as nb_open
Right click any ipynb file and select "Open with > Other" and select the nb_open in the Applications folder. Don't forget to check "Always Open With".
Select an ipynb file, get info (command + i) > Open With (select nb_open if not selected already) > Click Change All.... Done.
To "promote" Yogesh's helpful comment to a fully self-contained answer:
Windows 10
In a CMD or PowerShell window with administrative rights (e.g. launched quickly with Win+X, then A), run:
pip install nbopen
python -m nbopen.install_win
Profit!
Double-click on *.ipynb files now starts a new server or reuses an existing instance.
One way to open a Jupyter notebook directly by double-clicking on the file is to associate the .ipynb file extension with the jupyter-notebook command. Here's how to do it on a Windows system:
Right-click on the Jupyter notebook file that you want to open.
Select "Open with" and then choose "Choose another app".
Select "More apps" and then scroll down to the bottom and choose "Look for another app on this PC".
Navigate to the directory where the jupyter-notebook.exe file is located (usually in the Scripts subdirectory of your Python installation), and select it.
Check the box next to "Always use this app to open .ipynb files" and then click on "OK".
Now, when you double-click on an IPython notebook file, it should open directly in the Jupyter notebook.
On a Mac or Linux system, you can set the default application for .ipynb files by using the xdg-mime command. First, determine the full path to the jupyter-notebook executable:
which jupyter-notebook
This will return the path to the executable. Then, use the xdg-mime command to set the default application for .ipynb files:
xdg-mime default jupyter-notebook.desktop application/x-ipynb+json
Replace jupyter-notebook.desktop with the path to the jupyter-notebook executable that you determined earlier. Now, when you double-click on an IPython notebook file, it should open directly in the Jupyter notebook.