There was a problem compiling the code from your notebook, please check that you saved before submitting. Details: No module named 'test_your_code'

In Module 1 ,I passed all test cases but while submitting "There was a problem compiling the code from your notebook, please check that you saved before submitting. Details: No module named ‘test_your_code’ " This comment is given with grade 0.Kindly help what to do with this.

Hi @Coursera12,

I’m going to direct message you regarding this.

Hi @Coursera12,

After looking at your notebook, here are the issues:

You are trying to run everything related to an exercise in the same code cell. For example, here’s your exercise 1:

### START CODE HERE ###

# Store the title of the book `Brave New World` as a string
# Add your code here
import test_your_code

book_title = # Your solution code

# Store the author `Aldous Huxley` of the book as a string
# Add your code here
author = # Your solution code

# Store the year `1932` the book was published as an integer
# Add your code here
year_published = # Your solution code

# Store the number of available copies `4` of the book as an integer
# Add your code here
available_copies = # Your solution code

# Test your code!
test_your_code.exercise_1a(book_title, author, year_published, available_copies)
### END CODE HERE ###

Over here, you are not just implementing the exercise, but also making the import test_your_code import again, as well as running the test code test_your_code.exercise_1a(book_title, author, year_published, available_copies). This will obviously not work with the tests.

Next steps for you:

Open the assignment and click on the Help icon (?) on the top right. When the panel opens, click on get latest version. This should get a fresh copy of the assignment. Re-attempt the assignment again, and this time follow the instructions properly. Do not write extra code in the cells or change code that is not needed.

Run every cell from top to bottom. The first cell of the notebook is import test_your_code, by running this, you don’t have to re-use the import every time. Similarly, run the tests in their own separate cells as provided in the notebook.

Remember, the notebook is designed in a certain way for a reason, do not change or play around with its structure. Before attempting, read the instructions provided under TIPS FOR SUCCESSFUL GRADING OF YOUR ASSIGNMENT.

Best,
Mubsi

2 Likes

Thank You! It worked now.

1 Like