takluyver / nbopen

Open a Jupyter notebook in the best available server
BSD 3-Clause "New" or "Revised" License
301 stars 58 forks source link

404 not found #45

Open bfkeats opened 6 years ago

bfkeats commented 6 years ago

I've installed nbopen, and when I double-click on a notebook, I get the following error:

404 : Not Found You are requesting a page that does not exist!

The URL shows the path to the notebook

http://localhost:8888/notebooks/path%5Cto%5Cnotebook%5Cactual_notebook.ipynb

If I remove everything but http://localhost:8888 from the URL, I get a file tree, and I can click on the notebook to start it.

I'm running windows 7 enterprise, service pack 1, Python 3.6.1 :: Anaconda custom (64-bit)

Any ideas what might be causing this? Thanks in advance.

takluyver commented 6 years ago

Yes, I think it's got broken with Windows paths at some point - the backslashes need to be translated into forward slashes for the URL.

takluyver commented 6 years ago

I've just released 0.4.3 - can you update and try it again?

bfkeats commented 6 years ago

Closer. I'm still getting the same 404 error. The URL is:

http://localhost:8888/notebooks/path/to/notebook/actual_notebook.ipynb

The server seems to be residing in the local directory of the notebook however. If I delete all the path information as follows, the notebook opens correctly:

http://localhost:8888/notebooks/actual_notebook.ipynb

takluyver commented 6 years ago

Is this with a server already running, or with nbopen needing to start a server? Can you also have a look at the output of:

from notebook.notebookapp import list_running_servers
print(list(list_running_servers()))
bfkeats commented 6 years ago

Both with a server running and without.

[{'base_url': '/', 'hostname': 'localhost', 'notebook_dir': 'C:\\dDrive\\data', 'password': False, 'pid': 10400, 'port': 8888, 'secure': False, 'token': 'e4aa02081bd7c7a3b83a0ed9b589ca3005a53dc4dd467e55', 'url': 'http://localhost:8888/'}]

takluyver commented 6 years ago

Jupyter is telling us that the notebook server is running in C:\dDrive\data. Is that where the notebook is located? Or do you still need path\to\notebook after that?

bfkeats commented 6 years ago

Strange. When I go to http://localhost:8888/tree I don't see the contents of C:\dDrive\data. I see the contents of C:\dDrive\data\path\to\notebook

takluyver commented 6 years ago

That's odd. If that happens with a server not started by nbopen, then I think it's a Jupyter bug - it appears to be incorrectly recording where the server is running. I don't know how that happens, though.

bfkeats commented 6 years ago

Weird. I'll mess around and let you know if I figure anything out. Thanks for your help.