Where is ipython notebook hiding? - python

I have not used ipython-notebook in a while and I think I'm doing something wonky. When I launch it (with ipython notebook) I get a web interface that lets me edit files in the browser: but the menus are all MIA there's no way to run anything or add new cells.
I suspect that I'm missing something very simple and obvious, here. What am I doing wrong?

You'll need to create a new notebook.
Navigate back to http://localhost:8888/tree, browse to the folder where you want to create it, and then use the New menu on the right:

Related

Trusting a notebook is not working in PyCharm

I want to run a Jupyter notebook in PyCharm but on cells that are executing javascript, I get the message, that the notebook is not trusted.
When I click the "Trusted" checkbox, the arrow appears for a second and then disappears again. The notebook stays untrusted. Also using the command-line interface for Jupyter with
jupyter trust notebook.ipynb
doesn't work.
When I open the notebook on the browser with the same kernel running, it works just fine.
I also want to add that I have three projects open at the same time. When I just open the project, which is containing the notebook, I can click the "Trusted" checkbox and it will stay checked, but still, the javascript cells will not execute.
Maybe that's a bug, but probably I messed up some settings? Can you help me find out, which settings I can change and if there are other options to get the notebook trusted within the IDE?
Have a nice day!
I had the same problem when I moved the notebook's directory. What solved it for me in PyCharm was to copy and paste the notebook's content into a new file.
I came across this issue when specifying %matplotlib notebook.
Changing this to %matplotlib inline got the plotting to work.
Not fully understanding the issue or how this solves it but it is sufficient for my application.

Make Jupyter Notebook clickable

I did develop an application for several users on windows, without internet access using python and Jupyter Notebook as a graphical interface.
The application intend to process some data, they just have to copy paste the path to their datafile and run through different step.
As a user they just want to double click somewhere to open it. I may not fully understand Jupyter Notebook but I would like to find a simple way to make the notebook clickable ...
Could you help me ?
Thx
Have you looked at nteract? It was a suggestion in a similar question here, that was linked from a question with a similar title as yours, but referenced the previous version of the tech that is now Jupyter notebook.

In Jupyter notebook, how does one revert/refresh to the original notebook before any changes were made?

I'm forced to use jupyter notebook for a class. Somehow a code block got turned into text and now it won't run this cell. I want to revert the notebook to the original (the notebook provided by course without my programs added in) before I made any changes to it. How does one do this?
The only thing I could find was this at jupyter refresh
Refresh your notebook
1. Rename your existing Jupyter Notebook within the individual notebook view
2. In the notebook view, add “?forceRefresh=true” to the end of your notebook URL
3. Reload the screen
4. You will be directed to your home Learner Workspace where you’ll see both old and new Notebook files.
5. Your Notebook lesson item will now launch to the fresh notebook.
But I'm unsure what the first two steps mean. I tried renaming and then adding “?forceRefresh=true” at the end, but that didn't help. Perhaps someone could advise? Thanks

Coursera jupyterNotebook: revert to the beginning

I'm using jupyterNotebook from Coursera but see no way to revert everything to the beginning.
The only option relevant seems to be "Revert to Checkpoint" -- but I didn't save a checkpoint at the beginning.
Does it mean that I am unable to revert to it?
Open your notebook at Coursera
Rename it
After renaming just add ?forceRefresh=true to the end of your notebook URL
Hit enter
You now have old renamed version and new refreshed to default one
The procedure is described here.
As of July 2019 the ?forceRefresh=true solution worked for me.
These steps will work as of April, 2020:
Rename your notebook and add ?forceRefresh=true to the url and press enter. Your entire Jupyter notebook will be restarted. Go to the course week and a fresh notebook will be there.
Better late than never -
This is from the Coursera help section.
To keep your old work and also get a fresh copy of the initial Jupyter Notebook:
Make a copy of your Notebook by clicking File, then Make a copy. We recommend using a naming convention such as “Assignment 1 - Initial” and “Assignment 1 - Copy” to keep your notebook environment organized. You can also download this file locally.
Click Control Panel, then choose My Server
Find the name of your previous file, as well as the new copy of your file.
Delete the original notebook file (not the copy) by selecting the checkbox next to the filename. Click the trashcan icon that appears to delete the file.
Click Control Panel, then choose Stop My Server.
Select My Server to restart.
After a few minutes, launch the notebook again from your Course Home. If you get a 404 error while the notebook server restarts, wait a few minutes and try again.
After the restart is complete, you will see a fresh copy.
I believe this is a new feature in Coursera
This is the instruction from a course I was taking:
In any Jupyter notebook, first save your work by going clicking File -> Download as -> Notebook (.ipynb)
Next, click File -> Open. This opens up the file directory.
Select the notebook you wish to refresh from the list by clicking the check box next the the filename
Click the trashcan icon at the top to delete the notebook
Copy this text: ?forceRefresh=true and paste it onto the end of the URL in your browser bar then hit .
You will see your workspace refresh with the updated copy of the notebook
These steps:
1. Open your notebook at Coursera
2. Rename it
3. After renaming just add `?forceRefresh=true` to the end of your notebook URL
4. Hit enter
5. You now have old renamed version and new refreshed to default one
Still work as of 05/14/2021

Links between IPython notebooks

Is it possible to link one IPython notebook to another with a hyperlink in a Markdown cell? If I try
Link to [Notebook 2](files/notebook2.ipynb)
or
Link to Notebook 2
A new tab is opened with raw unformatted contents of the ipynb file. Is there a way to get IPython to open another notebook for use in a new tab via a hyperlink?
Since IPython 2 you may use exactly the syntax you first tried:
Link to [Notebook 2](notebook2.ipynb)
It is now possible to do this with Ipython 1.0+ at least.
Just do:
localhost:8888/My Notebook.ipynb
Here is the documentation for this feature.
https://github.com/ipython/ipython/pull/3058
From http://python.6.n6.nabble.com/where-is-the-code-to-generate-IPython-Notebook-URL-for-a-new-ipynb-file-td4996991.html:
You can access a json version of all the notebooks from url: $host/notebooks
Here is a snippet that worked for me:
import urllib2
import json
data = urllib2.urlopen("http://127.0.0.1:8888/notebooks")
json_data=data.read()
list_o_dicts=json.loads(json_data)
for d in list_o_dicts:
if d['name'] == 'test':
print d['notebook_id']
Modify this according to your need.
** on further reading, I just realized OP was also seeking new notebook creation, keeping my answer anyway as way to work with linking existing notebooks.
One way to try for OP's goal is to run a script which will create a new notebook.ipynb file into the ipython folder where ipython notebook was started from. That .ipynb file can be templated from a new ipython notebook created from dashboard, with the name and id of the notebook replaced with whatever you are trying to link from your existing notebook. I have not tried this, but should work since dropping a .ipynb extension file into ipython folder does show it up in the dashboard.
Remember that if your file name has spaces you will need to replace those with %20
eg:
[Numpy](Numpy%20For%20Python.ipynb)
In addition to akim's suggestion - you can link to any (py or ipynb) file using a relative link, starting with "edit", and and then from the directory where you started the server.
E.g. in a markdown cell, if I want to reference a file whose relative location (relative to my git repo, which is also where I launched the notebook server) is "./path/to/source.py", I'd add:
[link to source](/edit/path/to/source.py)
Unfortunately, this is not practically possible.
The link would need to be to the notebook ID
(e.g. /a1e2a88f-3b91-4a4e-8ca1-d4fd7240f750 for the one I'm working on right now).
This is an UUID created at startup by the IPython server.
So you can copy the link from IPython Dashboard, but it will be valid only until you restart.

Categories