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

nbgrader with Jupyterhub and Sqlalchemy not working #1796

Closed
christina-seegers opened this issue Jun 29, 2023 · 4 comments
Closed

nbgrader with Jupyterhub and Sqlalchemy not working #1796

christina-seegers opened this issue Jun 29, 2023 · 4 comments

Comments

@christina-seegers
Copy link

Operating system

?

nbgrader --version

0.8.4

jupyterhub --version (if used with JupyterHub)

2.3.1

jupyter notebook --version

none

Expected behavior

I can install nbgrader in Version 0.8.4 after installing JupyterHub 2.3.1.

Actual behavior

I get an error try to install Version 0.8.4 if I do not use Sqlalchemy 2.0 (which I can not because JupyterHub 2.x is not working with this Version 3.x does, but nbgrader does not support Version 3.x as far as I see).

Error:

[17/33] RUN jupyter nbextension install --symlink --sys-prefix --py nbgrader --overwrite:
#0 0.848 Traceback (most recent call last):
#0 0.848 File "/usr/local/bin/jupyter-nbextension", line 8, in
...
#0 0.848 File "/usr/local/lib/python3.8/dist-packages/nbgrader/exchange/default/collect.py", line 13, in
#0 0.848 from ...api import Gradebook, MissingEntry
#0 0.848 File "/usr/local/lib/python3.8/dist-packages/nbgrader/api.py", line 11, in
#0 0.848 from sqlalchemy.orm import (sessionmaker, scoped_session, relationship,
#0 0.848 ImportError: cannot import name 'DeclarativeBase' from 'sqlalchemy.orm' (/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/init.py)

Steps to reproduce the behavior

Start with installing jupyterhub (I used a docker image: jupyterhub/jupyterhub:2.3.1) and then install nbgrader 0.8.4

If I install sqlalchemy 2.x (before nbgrader) then there is no problem installing ... but the jupyterhub crashes, since it cannot run with sqlalchemy 2.x ...

@tuncbkose
Copy link
Contributor

I guess this means that #1788 should have bumped up the minimum version as well, DeclarativeBase change specifically is backwards-incompatible.

That said, I cannot think of why nbgrader 0.8.4 wouldn't work with some version of JupyterHub. If you could share the errors you encounter with sqlalchemy 2.x, I am happy to take a look.

I'll also be doing some Hub related things myself, so I can confirm if it is working or not, but it might take a while for me to get to it.

@christina-seegers
Copy link
Author

Connecting to db is followed by this output
jupyterhub | [E 2023-06-29 09:32:13.769 JupyterHub app:3297]
jupyterhub | Traceback (most recent call last):
jupyterhub | File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 3294, in launch_instance_async
jupyterhub | await self.initialize(argv)
jupyterhub | File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 2813, in initialize
jupyterhub | self.init_db()
jupyterhub | File "/usr/local/lib/python3.8/dist-packages/jupyterhub/app.py", line 1777, in init_db
jupyterhub | dbutil.upgrade_if_needed(self.db_url, log=self.log)
jupyterhub | File "/usr/local/lib/python3.8/dist-packages/jupyterhub/dbutil.py", line 112, in upgrade_if_needed
jupyterhub | orm.check_db_revision(engine)
jupyterhub | File "/usr/local/lib/python3.8/dist-packages/jupyterhub/orm.py", line 949, in check_db_revision
jupyterhub | alembic_revision = engine.execute(
jupyterhub | AttributeError: 'Engine' object has no attribute 'execute'
jupyterhub |
jupyterhub | [D 2023-06-29 09:32:13.770 JupyterHub application:1028] Exiting application: jupyterhub
notebook-dev |

Informations given about jupyterhub and sqlalchemy can be found here:
jupyterhub/dockerspawner#477 or here: jupyterhub/dockerspawner#478

As far as I see Jupyterhub 2.3.1 pinned sqlalchemy <2.
My try to force sqlalchemy to version 2 lead to successful installation of nbgrader 0.8.4 but destroyed the hub.

I will try working with version 0.8.3 of nbgrader.

@tuncbkose
Copy link
Contributor

tuncbkose commented Jun 30, 2023 via email

@brichet brichet closed this as completed Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants