Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook.services replaced in notebook version 7.0.0 #121

Closed
JnCoe opened this issue Jul 27, 2023 · 1 comment
Closed

notebook.services replaced in notebook version 7.0.0 #121

JnCoe opened this issue Jul 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JnCoe
Copy link

JnCoe commented Jul 27, 2023

  • nbautoexport version: 0.5.1
  • Python version: 3.10.6
  • Operating System: Windows 11 (Windows) and Ubuntu 22.04.2 (WSL)

Description

When running nbautoexport install I got the following error:

Traceback (most recent call last):
File "/home/jonas/myspace/bin/nbautoexport", line 5, in
from nbautoexport.nbautoexport import app
File "/home/jonas/myspace/lib/python3.10/site-packages/nbautoexport/init.py", line 1, in
from nbautoexport.export import post_save
File "/home/jonas/myspace/lib/python3.10/site-packages/nbautoexport/export.py", line 6, in
from notebook.services.contents.filemanager import FileContentsManager
ModuleNotFoundError: No module named 'notebook.services'

What I Did

notebook.services seem to have been replaced by jupyter_server.services in notebook version 7.0.0. I first uninstalled then reinstalled notebook using pip install notebook==6.5.4 and ran nbautoexport install again. This time, it worked, printing the message below and successfully converting a .ipynb file automatically when I tested it later:

nbautoexport post-save hook successfully installed with Jupyter.
If a Jupyter server is already running, you will need to restart it for nbautoexport to work.

Additionally, I reverted back to version 7.0.0 and made an edit in the nbautoexport/export.py file. I replaced the line from notebook.services.contents.filemanager import FileContentsManager with from jupyter_server.services.contents.filemanager import FileContentsManager. After making this change, I ran nbautoexport install again, and it worked as expected, displaying the same success message and successfully converting the file during subsequent testing.

I'm not sure about the consequences of modifying this particular line of code, but for now, I haven't encountered any noticeable issues.

@jayqi jayqi added the bug Something isn't working label Jul 27, 2023
@jayqi
Copy link
Member

jayqi commented Jul 28, 2023

Closed by #122, released as v0.5.2

@jayqi jayqi closed this as completed Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants