Hello, Jupyter suddenly stopped working, when I opened it, instead of my file system, it opened http://localhost:8888/tree with files I never seen in my life. I tried just open my notebook with path that Google Chrome saved, but get this page
If I try to open any existing folder with correct path, it does not find it. I tried to downgrade to old versions, to newest and I tried fix from this topic
None of this worked, please help me to fix this, thanks in advance!
PS - Notebook and folders I am trying to open, of course exist on my system.
You are providing very few details for us to help you.
Before “Jupyter suddenly stopped working”, how were you using it? Was it installed on your computer? Using a remote machine via JupyterHub? You tagged this with “JupyterHub” making this more confusing given other things you say. Because later you stress the files exist on your system. A local system or the one running the Hub? Also because you say you tried downgrading to old versions. Both of those latter steps seem to suggest you aren’t using JupyterHub and yet that is the only specifics provided.
If a JupyterHub weren’t involved, I’d just guess it opened your local Jupyter now and you didn’t expect that.
Explore around from inside the active Jupyter ipynb
file using ls
, ls -lah
, & pwd
, and then let us know better what you see in text pasted in as formatted blocks. You’ll also need %cd
to change directories from within your running Jupyter ipynb
file.
Tips for using this and related forums:
Screenshots alone are frowned upon. Please describe things with details in text. And only use screenshots in support of those descriptions when they may not be fully adequate. For example, the 404 image you include could easily be replaced with, “I get a Jupyter branded page saying 404: Not Found. You are requesting a page that does not exist!
and the URL in my addess bar is https://xxxxxxx???xxxx.” (Note how that even includes additional information you cut off, which is another reason screenshot are frowned upon as sole details: providers often miss including important details.)
One rationale for screenshots alone not being permitted is because isn’t indexable/searchable by the systems used to organize how to find answers for you and others. Please read Getting good answers to your questions. I’d refer you especially under the section ‘Help others reproduce the problem’, in the linked to How do I ask a good question? at the bottom there where it emphasizes in bold DO NOT post images of code, data, error messages, etc.
In case you didn’t know how to do one step I mention:
For pasting code in so it is readable in forums such as this, you’ll want to learn about ‘block code formatting’ here. (Or see about ‘fenced code blocks’ here. They are both the same thing if you look into the details. They just have slightly different terms used in the two locations.
No I am not using JupyterHub, it’s installed locally on my PC. I was using it running some code locally, and suddenly this happened (what I explained).
Explore around from inside the active Jupyter ipynb
file using ls
, ls -lah
, & pwd
, and then let us know better what you see in text pasted in as formatted blocks. You’ll also need %cd
to change directories from within your running Jupyter ipynb
file.
I don’t really understand what you mean by that, Jupyter does not “see” any of my ipynb
files. I think I explained situation quite well (apart that I made mistake tagging it with JupyterHub) Okay once more, It worked, and then next day, I tried to run it, and instead of open “navigation” on my PC, it opened http://localhost:8888/tree with some files I don’t know. I tried to open my Notebook file with full browser path (which saved in Chrome) and get that 404 error, if I try to simplify path, like to go to my “Documents” I also get 404, but all this files and folders exist on system. To make it even more simple “Jupyter navigation stopped working, and it does not see files and folders that actually it seen and exist now like they existed before”.
More info, using Windows 10
What I am getting at is that Jupyter is seeing something there in the tree
page. (These files you don’t recognize.) It may not be what you expect, but it is seeing something and we have no way to know that is because you aren’t providing details, such as where is that in relation to your notebook files in your system’s file hierarchy. Open a new notebook if you can and in it run pwd
in the running .ipynb
file and record the result. How does that path relate to the location of your .ipynb
files? Can you use %cd
to change the directory to where the .ipynb
files are and then open them?
Also, before we keep going down this road, I have to ask…
Is OneDrive involved?
Minor:
Also, so I can fix the tag, what flavor of Jupyter are you using? JupyterLab?
I am sorry, I a bit noob in this, I ran it as “jupyter notebook” and don’t how to check flavor or version of it.
So I runned pwd, and I get that I am in ‘C:\Windows\system32’
And my files are in PC/Documents (that standard Windows documents folder)
I did %cd and it showed me C:\Users\Home
One drive not involved, everything is installed locally.
Thanks for your help
Hmmm… wasn’t actually suggesting you run %cd
in your notebook as just that alone. %cd
alone seems to be equivalent to %cd $home
or %cd
. You were supposed to use that to change directories by specifying a path after %cd
. %cd
is the equivalent of ‘change directory’ command for working in active Jupyter .ipynb
file. The magic part, indicated by the magic %
symbol, makes it persistent. (Read more about it here.) You should be able to use %cd
to navigate over to the place where your files are by providing the path after %cd
. As you still haven’t provided details, I cannot give you an outline of how to switch, but something like:
%cd C:\Users\YourName\MyDocuments
To work that out you may have to play around with ls
to see what you can see.
Then when you switch using a valid %cd path/to/directory/
, you should see feedback in the output of the cell saying what directorty it switched to after. And then run pwd
. They should be the same now. pwd
stands for ‘print working directory’. You should use it regulary when getting your bearings in a notebook. Maybe not leave the cell and the result there but use it.
Based on what you said the tree
page should be listing what is in C:\Windows\system32
I gather?
Next, you can hopefully from the tree
page now open a notebook that is over where your files are. Under File
do you have an option that is ‘Open from Path...
’? If so, select that and put in the path to a notebook file in your MyDocuments folder relative to the there. Or try the entire path for an actual notebook file. (If the ‘long way’ now works you know all is well and you can manage is something like this happens again, yet you may wish to restore your start up directory to where you prefer, and so see here for guidance about trying to adjust that as you may prefer.)
On that tree
page there is no option under ‘Help’ to check anything ‘About…’? Or when you are in the running Jupyter .ipynb
file?
That’s what I get from Help → About
You are using Jupyter Notebook.
Python 3.10.14 | packaged by Anaconda, Inc. | (main, May 6 2024, 19:44:50) [MSC v.1916 64 bit (AMD64)]
That’s all
There is no such thing as “Open from path” there is only “Open” and when I press that, I get into “tree” again (System32 folder).
Yes I navigate to folder where my notebook are, did ls, and yes it printed my notebooks. And I did pwd and I have full path to folder where notebooks are, but don’t what to do with it.
Well at least now we know you are using Notebook and I changed the heading.
Hmmm… it doesn’t say what version of the Notebook software you have there?
If you run the following in a cell in your active .ipynb
file does it show it by any chance:
!jupyter --version
http://localhost:8888/notebooks/Documents/mynotebooks/notebook.ipynb
That’s example of old working path, now it says 404.
That’s what I get from !jupyter --version
Selected Jupyter core packages…
IPython : 8.15.0
ipykernel : 6.25.0
ipywidgets : 8.0.4
jupyter_client : 7.4.9
jupyter_core : 5.5.0
jupyter_server : 1.23.4
jupyterlab : 3.6.3
nbclient : 0.8.0
nbconvert : 7.10.0
nbformat : 5.9.2
notebook : 6.5.4
qtconsole : 5.5.0
traitlets : 5.7.1
Before trying anything below… Did you try this yet? (It was on that same page I referenced earlier.)
That makes sense. I was starting to suspect given the lack of Open from Path...
, you may be using Jupyter Notebook 6.5 or earlier.
You’ll need the version information to decide how to reset the start up folder using information there. I believe you want the way that is indicated involving c.NotebookApp.notebook_dir
; don’t let your JupyterLab version throw you off. I think! (I’m a little confused about your versions here and the fact that top answer hasn’t been updated in about three years.) I’m guessing you want it set back to above Documents
given you say the old path is http://localhost:8888/notebooks/Documents/mynotebooks/notebook.ipynb
And we know you notebooks are still on your machine because you used pwd
, ls
, and %cd
and can see them. That is very important.
I take it you cannot see the directory Documents
from in the list in inside http://localhost:8888/tree
? You could use things again now by moving copies to where you can see and then move the new versions back later. Not very satisfactory, but could work.
Another thing to consider though is your JupyterLab and Jupyter Notebook versions are old relative to current versions. If you are happy with them though, resetting where Jupyter starts or moving the files to where it is starting is the easiest thing now.
Does not work, I guess because I use Anaconda PowerShell to move into “environment” and then run “jupyter notebook”.
When I am in “tree” in fact I am in System32 of Windows, for some reason. How I can update everything to the latest version? And then maybe something will change…
Since now you bring up that Anaconda is involved? Did you try the suggestions there about %USERPROFILE%
or other ones involving Anaconda to reset your starting location?
Or this one that some Windows people say works fairly recently?
If you did want to go with updating…
You’d want to uninstall as much as you can and clean out as best you can. And then since you are using Anaconda, install the current version of the Anaconda Distribution. Make sure you set aside any environments or things you need to keep.
Bear in mind though that Jupyter Notebook 7+ is built on JupyterLab components and so things are much different. If you were relying on special features or old extensions, you’d want to be more cautious.
I’ve checked that threat, strange very strange, I just run Jupyter Notebook from shortcut, and correct directory opened, and everything works, tried to run from console (as before) still getting into System32.