jupyter / nbgrader

A system for assigning and grading notebooks
https://nbgrader.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.28k stars 316 forks source link

"Loading, please wait..." message not resolving under "Manage Assignments" #1710

Open dynelson opened 1 year ago

dynelson commented 1 year ago

Hi nbgrader Support --

This question relates to nbgrader version 0.8.1, Jupyter Notebook version 6.5.2 and Mac OS Ventura 13.0.1. I am not using Jupyter Hub.

Three submissions are listed in the Formgrader window. After clicking on "3" in the "Manage Assignments" window, the assignments fail to load in the "Manage Submissions" window. Instead, a "Loading, please wait...." message is displayed under the "Student Name" column and just hangs.

I've tried to modify the nbgrader_config.py file to fix this problem. I have two versions of this file: one in the root directory, the other in the COURSENAME file. Here's how I've defined the course_id and root parameters:

c.CourseDirectory.course_id = "CS1" c.CourseDirectory.root = "/Users/davidyrueta/CS1/"

Here's the terminal display after clicking on "# of Submissions:"

[C 04:50:06.634 NotebookApp] Unwritable directory, please contact your instructor: /srv/nbgrader/exchange [C 04:50:06.636 NotebookApp] Unwritable directory, please contact your instructor: /srv/nbgrader/exchange [C 04:50:06.639 NotebookApp] Unwritable directory, please contact your instructor: /srv/nbgrader/exchange [C 04:50:06.766 NotebookApp] Unwritable directory, please contact your instructor: /srv/nbgrader/exchange [C 04:50:17.514 NotebookApp] Unwritable directory, please contact your instructor: /srv/nbgrader/exchange [E 04:50:17.533 NotebookApp] Uncaught exception GET /formgrader/api/submissions/ps1 (::1) HTTPServerRequest(protocol='http', host='localhost:8890', method='GET', uri='/formgrader/api/submissions/ps1', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 1711, in _execute result = method(*self.path_args, self.path_kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 3208, in wrapper return method(self, *args, *kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/base.py", line 108, in wrapper return f(self, args, kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/base.py", line 117, in wrapper return f(self, *args, *kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/apihandlers.py", line 167, in get submissions = self.api.get_submissions(assignment_id) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/apps/api.py", line 587, in get_submissions db_submissions = gb.submission_dicts(assignment_id) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/api.py", line 3053, in submission_dicts all_scores = aliased(union_all( File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/orm/util.py", line 1357, in aliased return AliasedClass( File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/orm/util.py", line 496, in init mapper = insp.mapper AttributeError: 'CompoundSelect' object has no attribute 'mapper' [E 04:50:17.546 NotebookApp] { "Host": "localhost:8890", "Accept": "application/json, text/javascript, /*; q=0.01", "Referer": "http://localhost:8890/formgrader/manage_submissions/ps1", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" } [E 04:50:17.546 NotebookApp] 500 GET /formgrader/api/submissions/ps1 (::1) 35.350000ms referer=http://localhost:8890/formgrader/manage_submissions/ps1

At this point I don't know what else to do. Any help would be greatly appreciated!

Screenshot 2022-12-12 at 5 15 33 PM Screenshot 2022-12-12 at 5 19 20 PM
perllaghu commented 1 year ago

Have you created the directory /srv/nbgrader/exchange (as per the warning in formgrader)?

dynelson commented 1 year ago

Hi perllaghu -- Nope, I hadn't. Sorry for being such a newbie, and thank you for taking a look!

I wrote the command to make /srv/nbgrader/exchange per the docs. Now when I click on "# of Submissions" this is the output:

[E 04:37:28.571 NotebookApp] Uncaught exception GET /formgrader/api/submissions/ps1 (::1) HTTPServerRequest(protocol='http', host='localhost:8890', method='GET', uri='/formgrader/api/submissions/ps1', version='HTTP/1.1', remote_ip='::1') Traceback (most recent call last): File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 1711, in _execute result = method(*self.path_args, self.path_kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 3208, in wrapper return method(self, *args, *kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/base.py", line 108, in wrapper return f(self, args, kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/base.py", line 117, in wrapper return f(self, *args, *kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/apihandlers.py", line 167, in get submissions = self.api.get_submissions(assignment_id) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/apps/api.py", line 587, in get_submissions db_submissions = gb.submission_dicts(assignment_id) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/api.py", line 3053, in submission_dicts all_scores = aliased(union_all( File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/orm/util.py", line 1357, in aliased return AliasedClass( File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/orm/util.py", line 496, in init mapper = insp.mapper AttributeError: 'CompoundSelect' object has no attribute 'mapper' [E 04:37:28.584 NotebookApp] { "Host": "localhost:8890", "Accept": "application/json, text/javascript, /*; q=0.01", "Referer": "http://localhost:8890/formgrader/manage_submissions/ps1", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15" } [E 04:37:28.584 NotebookApp] 500 GET /formgrader/api/submissions/ps1 (::1) 30.490000ms referer=http://localhost:8890/formgrader/manage_submissions/ps1

I looked up the error Uncaught exception GET and read this error can be resolved by upgrading nbconvert, so I typed

pip install --upgrade --user nbconvert

and received these messages:

WARNING: The scripts jupyter-dejavu and jupyter-nbconvert are installed in '/Users/davidyrueta/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. spyder 5.3.3 requires pyqt5<5.16, which is not installed. spyder 5.3.3 requires pyqtwebengine<5.16, which is not installed. nbgrader 0.6.2 requires nbconvert==5.6.1, but you have nbconvert 7.2.6 which is incompatible. nbgrader 0.6.2 requires sqlalchemy<1.4, but you have sqlalchemy 1.4.39 which is incompatible. nbgrader 0.6.2 requires traitlets==4.3.3, but you have traitlets 5.1.1 which is incompatible.

Do I need to revert to lower versions of nbconvert, sqlalchemy and traitlets?

dynelson commented 1 year ago

I tried downgrading to 5.6.1 with the command conda install "nbconvert=5.6.1" and received this message:

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

Specifications:

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for. When python appears to the right, that indicates that the thing on the left is somehow not available for the python version you are constrained to. Note that conda will not change your python version to a different minor version unless you explicitly specify that.

Thoughts? Thank you!

perllaghu commented 1 year ago

Hmm... nbconvert should be a problem any more.

What version of nbgrader are you using (pip list)?

I have the following (massively cut down from my full list)

jupyter_client            7.3.0
jupyter_console           6.4.4
jupyter_core              4.9.2
jupyter_server            1.17.0
jupyterlab                3.3.4
nbclassic                 0.3.7
nbclient                  0.6.3
nbconvert                 6.5.0
nbformat                  5.3.0
nbgrader                  0.7.1
notebook                  6.4.11
sqlalchemy                1.4.36

NBGrader 0.6.0 did have nbconvert problems, but they were fixed in later releases

dynelson commented 1 year ago

Hi Ian —

Here’s what I’ve got:

jupyter_client 7.4.7 jupyter_console 6.4.3 jupyter_core 4.11.2 jupyter_server 1.18.1 jupyterlab 3.5.0 nbclassic 0.4.8 nbclient 0.5.13 nbconvert 7.2.6 nbformat 5.5.0 nbgrader 0.6.2 notebook 6.5.2 sqlalchemy 1.4.39

On Dec 14, 2022, at 5:45 AM, Ian Stuart @.***> wrote:

Hmm... nbconvert should be a problem any more.

What version of nbgrader are you using (pip list)?

I have the following (massively cut down from my full list)

jupyter_client 7.3.0 jupyter_console 6.4.4 jupyter_core 4.9.2 jupyter_server 1.17.0 jupyterlab 3.3.4 nbclassic 0.3.7 nbclient 0.6.3 nbconvert 6.5.0 nbformat 5.3.0 nbgrader 0.7.1 notebook 6.4.11 sqlalchemy 1.4.36 NBGrader 0.6.0 did have nbconvert problems, but they were fixed in later releases

— Reply to this email directly, view it on GitHub https://github.com/jupyter/nbgrader/issues/1710#issuecomment-1350886411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMHY3W67PXYEBQ6KAYSAYTWNGQN5ANCNFSM6AAAAAAS4FBN4Q. You are receiving this because you authored the thread.

perllaghu commented 1 year ago

Can you upgrade to nbgrader 0.7?

dynelson commented 1 year ago

Sure. Can you tell me what to type? I tried conda install “nbgrader = 0.7.0” and received this message

Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

The command I used to install nbgrader was

conda install -c conda-forge nbgrader

Thank you!

On Dec 14, 2022, at 6:33 AM, Ian Stuart @.***> wrote:

Can you upgrade to nbgrader 0.7?

— Reply to this email directly, view it on GitHub https://github.com/jupyter/nbgrader/issues/1710#issuecomment-1351072772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMHY3WK4HZFEJXRGDQCWVLWNGV7VANCNFSM6AAAAAAS4FBN4Q. You are receiving this because you authored the thread.

perllaghu commented 1 year ago

conda upgrade nbgrader will upgrade the library nbgrader to the latest version

(to install/upgrade to a specific version, you need conda <whatever> nbgrader==x.y.z - no spaces & double-equals)

dynelson commented 1 year ago

I ran that command and it seemed to execute. But when I ran pip list, nbgrader returns as version 0.6.2.

Should I try to uninstall and reinstall Anaconda?

On Dec 14, 2022, at 6:48 AM, Ian Stuart @.***> wrote:

conda upgrade nbgrader will upgrade the library nbgrader to the latest version

— Reply to this email directly, view it on GitHub https://github.com/jupyter/nbgrader/issues/1710#issuecomment-1351138155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMHY3SYSC5EIVU4NSVZHYLWNGXYXANCNFSM6AAAAAAS4FBN4Q. You are receiving this because you authored the thread.

dynelson commented 1 year ago

Hi perllaghu -- I seem stuck at nbgrader version 0.6.2 and can't upgrade.

I followed the instructions here https://docs.anaconda.com/anaconda/install/uninstall/ to remove the anaconda3 distribution from my machine. I then ran the graphical installer to reinstall Anaconda. That failed with a message saying Anaconda is already installed on the machine, and to update to the latest version.

I followed the prompts and ran conda update anaconda to upgrade to anaconda3. When I opened a Jupyter notebook, Formgrader was gone, so I reinstalled nbgrader using the command conda install -c conda-forge nbgrader.

Formgrader appeared, but Manage Submissions still won't load. When I ran pip list, I'm still stuck at nbgrader version 0.6.2, and can't seem to upgrade.

Thoughts? Thanks for all your help.

dynelson commented 1 year ago

Last comment. After uninstalling and reinstalling Anaconda, I ran the script in the terminal to reinstall the nbgrader package, and received this message:

(base) davidyrueta@Davids-MBP-2 ~ % conda install -c conda-forge nbgrader Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: done\

It seems that the version of nbgrader from the "next repodata source" is 0.6.2:

The following NEW packages will be INSTALLED:

alembic conda-forge/noarch::alembic-1.8.1-pyhd8ed1ab_0 importlib_resourc~ conda-forge/noarch::importlib_resources-5.10.1-pyhd8ed1ab_0 mako conda-forge/noarch::mako-1.2.4-pyhd8ed1ab_0 nbgrader conda-forge/osx-64::nbgrader-0.6.2-py39h6e9494a_2 python_abi conda-forge/osx-64::python_abi-3.9-2_cp39 rapidfuzz conda-forge/osx-64::rapidfuzz-2.13.6-py39h7a8716b_0

This must be why I'm stuck at 0.6.2, which seems related to the particular type of "environment solution" implemented by the installer. Is there any way to fix this?

Thanks!

perllaghu commented 1 year ago

You don't need to remove the whole anaconda install to upgrade a library

It's tricky for me to replicate what you have, as I run jupyter notebooks in a cluster, not on my workstation, and I already have a different method of installing python libraries across the various projects & services & code-bases I have.

conda install -c conda-forge nbgrader==0.8.1 doesn't work for you?

perllaghu commented 1 year ago

Ah... and you can also try conda install -c conda-forge nbgrader -v -v -v for lots and lots and lots of verbose information.... that may tell you what's locking nbgrader to such an old version

dynelson commented 1 year ago

It doesn’t seem to:

(base) @.*** ~ % conda install -c conda-forge nbgrader==0.8.1 Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: \

I’m stuck here for now.

At this point, I imagine my issue is way beyond nbgrader and into the particulars of my machine config. Just want to let you know I really appreciate your help.

On Dec 14, 2022, at 9:09 AM, Ian Stuart @.***> wrote:

You don't need to remove the whole anaconda install to upgrade a library

It's tricky for me to replicate what you have, as I run jupyter notebooks in a cluster, not on my workstation, and I already have a different method of installing python libraries across the various projects & services & code-bases I have.

conda install -c conda-forge nbgrader==0.8.1 doesn't work for you?

— Reply to this email directly, view it on GitHub https://github.com/jupyter/nbgrader/issues/1710#issuecomment-1351425443, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMHY3QKRJ3TDSZAGDTJZJ3WNHIIBANCNFSM6AAAAAAS4FBN4Q. You are receiving this because you authored the thread.

perllaghu commented 1 year ago

Yep.... There's some other library that has nbgrader=0.6.* has a requirement - and that's stopping the update

dynelson commented 1 year ago

OK, well I'll try to follow up on that idea elsewhere and see where I get. If I can find a solution, I'll make sure to post it. Thanks again!

dynelson commented 1 year ago

For what it's worth, I encountered the sam problem while trying to install nbgrader on a different Mac running Ventrura. I'm wondering if the issue is related to Ventura.

dynelson commented 1 year ago

UPDATE: Writing conda install jupyter in the terminal resolved the package inconsistencies and allowed me to upgrade to nbgrader version 0.8.1, but didn't resolve the loading issue.

Here is the terminal output that results from trying to load assignments into the "Manage Assignments" window:

[E 17:31:52.161 NotebookApp] Uncaught exception GET /formgrader/api/submissions/ps1 (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8891', method='GET', uri='/formgrader/api/submissions/ps1', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 1702, in _execute result = method(*self.path_args, self.path_kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 3173, in wrapper return method(self, *args, *kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/base.py", line 108, in wrapper return f(self, args, kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/base.py", line 117, in wrapper return f(self, *args, *kwargs) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/server_extensions/formgrader/apihandlers.py", line 167, in get submissions = self.api.get_submissions(assignment_id) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/apps/api.py", line 587, in get_submissions db_submissions = gb.submission_dicts(assignment_id) File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/nbgrader/api.py", line 3053, in submission_dicts all_scores = aliased(union_all( File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/orm/util.py", line 1357, in aliased return AliasedClass( File "/Users/davidyrueta/opt/anaconda3/lib/python3.9/site-packages/sqlalchemy/orm/util.py", line 496, in init mapper = insp.mapper AttributeError: 'CompoundSelect' object has no attribute 'mapper' [E 17:31:52.169 NotebookApp] { "Host": "localhost:8891", "Accept": "application/json, text/javascript, /*; q=0.01", "Referer": "http://localhost:8891/formgrader/manage_submissions/ps1", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0"

Any help interpreting this would be greatly appreciated!

brichet commented 5 months ago

@dynelson what is the status of this issue ? Did you fix it ?

dynelson commented 5 months ago

Nope, never did. Had to move on. If you’re interested in a working alternative to NbGrader, let me know and we discuss what I ended up using.

On Mar 21, 2024, at 8:37 AM, Nicolas Brichet @.***> wrote:

@dynelson https://github.com/dynelson what is the status of this issue ? Did you fix it ?

— Reply to this email directly, view it on GitHub https://github.com/jupyter/nbgrader/issues/1710#issuecomment-2012177574, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKMHY3RDWVNNX73XL4VS6HTYZLIBZAVCNFSM6AAAAAAS4FBN4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGE3TONJXGQ. You are receiving this because you were mentioned.