Closed clhedrick closed 4 months ago
What is the actual error you observed?
I'm giving you the whole error below. But note the last line, which is the key. It's using sqlalchemy from the user's home directory. When I remove /home/XXX/.local/lib, it starts working.
I can force a failure by defining any module used by jupyterhub with a bogus definition in /home/XXX/.local
I can fix it by setting env['PYTHONNOUSERSITE'] = "1" in LocalProcessSpawner getenv
However that's less than optimal, because that environment variable is then set in all kernels, which we don't want. We want users to be able to use their own modules in code they write. For the moment I'm adding env['PYTHONNOUSERSITE'] = "" to all the kernel.json files.
Oct 22 01:29:58 data7.cs.rutgers.edu jupyterhub: from .handlers import load_jupyter_server_extension
Oct 22 01:29:58 data7.cs.rutgers.edu jupyterhub: File "/usr/lib/anaconda3/lib/python3.11/site-packages/nbgrader/server_extensions/assignment_list/ha\
ndlers.py", line 17, in
From: Jakub Klinkovský @.> Sent: Wednesday, October 25, 2023 3:39 PM To: jupyter/nbgrader @.> Cc: Charles Hedrick @.>; Author @.> Subject: Re: [jupyter/nbgrader] student python packages can interfere with nbgrader (Issue #1842)
What is the actual error you observed?
— Reply to this email directly, view it on GitHubhttps://github.com/jupyter/nbgrader/issues/1842#issuecomment-1779935242, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAORUCATXIVRX4QMWI7ACNLYBFTGBAVCNFSM6AAAAAA6PYCQMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZZHEZTKMRUGI. You are receiving this because you authored the thread.Message ID: @.***>
This ImportError
based on a regression that shipped in 0.8.4, but is now fixed in 0.8.5: https://github.com/jupyter/nbgrader/commit/7079e6af82abb4baeda4fcca4cbcab238cfe32d1
Seems to be solved, thanks @shreve for the update.
Feel free to reopen it if the issue is still relevant.
Operating system
Ubuntu 22.03
nbgrader --version
Python version 3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0] nbgrader version 0.8.4
jupyterhub --version
(if used with JupyterHub)3.1.1
jupyter
lab--version
3.6.5
Expected behavior
Several students installed versions of sqlalchemy for use in their notebooks. This causes nbgrader to be unable to find their assignments. My interpretation of the error is that nbgrader tried to use their version of sqlalchemy, and it was missing an extension needed by nbgrader.
I would expect that the jupyter framework and nbgrader would use python paths that don't include anything in the user's home directory. I tried to modify code to do this, but was unable to find a place that fixed the problem.