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

"Module not found" error when autograding #1876

Open
jnak12 opened this issue Apr 2, 2024 · 3 comments
Open

"Module not found" error when autograding #1876

jnak12 opened this issue Apr 2, 2024 · 3 comments

Comments

@jnak12
Copy link

jnak12 commented Apr 2, 2024

Operating system

RedHat

nbgrader --version

0.9.1

jupyterhub --version (if used with JupyterHub)

4.1

jupyter notebook --version

7.1.2

Expected behavior

We have an assignment that was put in a folder and it has the following files:
CGastTest.ipynb
CGwat.ipynb
CGwatTest.ipynb
P0.ipynb
P0ParsingTest.ipynb
P0TypeCheckingTest.ipynb
SC.ipynb
SCTest.ipynb
ST.ipynb
STTest.ipynb
'01 Extending P0 with Bitwise Set Operations (WASM) [24 points].ipynb'

Inside some of the files (e.g. P0ParsingTest.ipynb) are the lines:

import nbimporter; nbimporter.options["only_defs"] = False
from P0 import compileString

Expected behaviour: file is auto graded.

Actual behavior

If the file is opened, each cell runs without issue.
But once submitted and autograded, the following error shows up:

ModuleNotFoundError: No module named 'P0'

From what I have been told, nbimporter converts a notebook to a module.

@perllaghu
Copy link
Contributor

I know nothing about nbimporter, so can't help with that, however I'm also surprised to get to autograde '01 Extending P0 with Bitwise Set Operations (WASM) [24 points].ipynb' (I would have expected the braces to give you problems)

@jnak12
Copy link
Author

jnak12 commented Apr 2, 2024

That seems to be okay. I don't know much about nbimporter either, but if it has to create a new file from the notebook conversion, where would it put that file? In the autograded directory? Can files get created in the autograded directory?

@brichet
Copy link
Contributor

brichet commented Apr 9, 2024

Thanks for opening this @jnak12.

Except if there is another repo for nbimporter, I would recommend not to use this package:
https://github.com/grst/nbimporter?tab=readme-ov-file#update-2019-06-i-do-not-recommend-any-more-to-use-nbimporter

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