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

Missing notebook.auth submodule? #7015

Closed
apowers313 opened this issue Aug 21, 2023 · 4 comments · Fixed by #7244
Closed

Missing notebook.auth submodule? #7015

apowers313 opened this issue Aug 21, 2023 · 4 comments · Fixed by #7244

Comments

@apowers313
Copy link

Description

notebook.auth disappeared in notebook 7.x?

Importing notebook.auth raises a ModuleNotFoundError. Importing notebook by itself works fine, and it seems that the auth submodule was removed. Works with 6.x and I can't find anything in the changelog that says this API was removed.

Reproduce

As mentioned in countless tutorials, with notebook 7.x installed:

from notebook.auth import passwd
passwd("foo")

Expected behavior

Should yield a hashed password that can be dropped into a config file.

@apowers313 apowers313 added bug status:Needs Triage Applied to issues that need triage labels Aug 21, 2023
@jtpio
Copy link
Member

jtpio commented Aug 21, 2023

Thanks @apowers313 for opening this issue.

Similar to #7010, this is because Notebook 7 is now based on Jupyter Server.

You can achieve the same result by importing from jupyter_server instead:

from jupyter_server.auth import passwd
passwd("foo")

@jtpio
Copy link
Member

jtpio commented Aug 21, 2023

Maybe this should be documented in the migration guide for visibility: https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

@apowers313
Copy link
Author

+1 to documentation. The three places I looked before posting a bug were:

  1. Migration notes
  2. Changelog
  3. Config docs

@jtpio
Copy link
Member

jtpio commented Aug 21, 2023

Maybe the following changes to the docs would help then:

  • Migration notes: add new section about using the jupyter_server imports
  • Changelog: Move the 7.0 highlights to the top of the changelog for better visibility, since they already include a link to the migration guide.
  • Config docs: new section / warning about this change in Notebook 7, and redirect to the Jupyter Server docs.

@RRosio RRosio removed the status:Needs Triage Applied to issues that need triage label Aug 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants