Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
120 views
in Technique[技术] by (71.8m points)

Django extensions shell_plus with jupyter lab

I've been trying to use ./manage.py shell_plus --lab command but i keep getting following error:

...
  File "/home/user/.local/share/virtualenvs/project-MorsWGAo/lib/python3.8/site-packages/django_extensions/management/commands/shell_plus.py", line 556, in handle
    runner()
  File "/home/user/.local/share/virtualenvs/project-MorsWGAo/lib/python3.8/site-packages/django_extensions/management/commands/shell_plus.py", line 303, in run_jupyterlab
    self.run_notebookapp(app, options)
  File "/home/user/.local/share/virtualenvs/project-MorsWGAo/lib/python3.8/site-packages/django_extensions/management/commands/shell_plus.py", line 237, in run_notebookapp
    app.initialize(notebook_arguments)
  File "/home/user/.local/share/virtualenvs/project-MorsWGAo/lib/python3.8/site-packages/jupyterlab/labapp.py", line 732, in initialize
    super().initialize()
  File "/home/user/.local/share/virtualenvs/project-MorsWGAo/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 403, in initialize
    raise JupyterServerExtensionException(msg)
jupyter_server.extension.application.JupyterServerExtensionException: This extension has no attribute `serverapp`. Try calling `.link_to_serverapp()` before calling `.initialize()`.

I'm using pipenv this would be potentially relevant parts of my Pipfile:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[scripts]
dev = "./scripts/dev.sh"

[requires]
python_version = "3.8"

[pipenv]
allow_prereleases = true

[packages]
Django = "~=3.0.0"
...
django-extensions = "*"
...
[dev-packages]
flake8 = "*"
autoflake = "*"
bpython = "*"
epc = "*"
importmagic = "*"
ipdb = "*"
ipython = "*"
pyls-black = "*"
pyls-isort = "*"
coverage = "*"
werkzeug = "*"
jupyterlab = "*"

I'd really appreciate any help with this. Thx in advance.

EDIT

Simple workaround would be to use ./manage.py shell_plus --notebook and then in browser simply navigating to /lab and choosing Django Shell-Plus in notebooks section.

question from:https://stackoverflow.com/questions/65863227/django-extensions-shell-plus-with-jupyter-lab

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...