-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Lasagna]: ImportError
While Doing Exercise
#3181
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
Hi @LindaK92 👋🏽 Thanks for filing this issue. As the Python track maintainer, i'd like to apologize -- that is bad logic in the test file, resulting in a bogus error message. We're using the logic for a missing function name, but it needs to be doing something different here. We'll try to get that bug fixed as quickly as we can. However - mixed up in that erroneous message is a legitimate problem telling you that the test runner cannot import a name that it needs. It sadly happens to be lying about what kind of name it is trying to import. 🤦🏽♀️ The tests are looking for a constant named EXPECTED_BAKE_TIME = <replace with some numeric value you fill in here>
PREPARATION_TIME = <replace with some other numeric value you fill in here>
def bake_time_remaining(time):
return <replace with code that uses the constants here>
def preparation_time_in_minutes(num_layers):
return <replace with more code you fill in here> For the quick test I did in my account on the website, if I don't have that first line defining the constant, I get the same stack trace you do. I think if you define (and use) that missing constant, the test runner will stop complaining. Please let me know if that is not the case, and I'll try to help you further with getting unstuck (or help identify any additional bugs). Again - apologies for the lying test runner. 😉 @iHiD or @ErikSchierboom -- could one of you transfer this to the |
This comment was marked as duplicate.
This comment was marked as duplicate.
I did the Hello_world test and encountered an error on submission as seen below. Kindly assist. We received the following error when we ran your code: |
Hi @bo1658a 👋🏽 As stated in the auto-response for the last issue you opened on this repo, we would prefer if you first raised issues in our exercism forum, and not here in the Python repo. The forum has many friendly people who would love to discuss and help students with issues they encounter. Another alternative is to use our CLI to upload your partial solution and request mentoring. A mentor can walk through your solution and point out where things might have gone wrong. My reply in this forum post might also be helpful for you. In the future, please don't comment on an unrelated exercise (this issue is in regards to Guido's Gorgeous Lasagna and not Hello World), as it creates confusion and noise. Many thanks, and good luck with the exercise. |
ImportError
While Doing Exercise
@ErikSchierboom or @iHiD - any chance I could get eyes/approvals for the following related issues? #3339, #3344, and python-test-runner #110. |
Done |
Hi all!
I hope this forum is the right place to put bugs.
I am doing excersise 2 (Lasagna) from Python and I get an import error, see below.
I do not think I made a mistake with programming, because I have also looked at the solutions from the community and when I enter the exact same solution, it gives the same error. Now I cannot continue.
So how can this problem be fixed? Thank you very much!
"
We received the following error when we ran your code:
ImportError while importing test module '.mnt.exercism-iteration.lasagna_test.py'.
Hint: make sure your test modules.packages have valid Python names.
Traceback:
.mnt.exercism-iteration.lasagna_test.py:6: in
from lasagna import (EXPECTED_BAKE_TIME,
E ImportError: cannot import name 'EXPECTED_BAKE_TIME' from 'lasagna' (.mnt.exercism-iteration.lasagna.py)
During handling of the above exception, another exception occurred:
.usr.local.lib.python3.10.importlib.init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
.mnt.exercism-iteration.lasagna_test.py:23: in
raise ImportError("In your 'lasagna.py' file, we can not find or import the"
E ImportError: In your 'lasagna.py' file, we can not find or import the function named 'EXPECTED_BAKE_TIME()'. Did you mis-name or forget to define it?
"
The text was updated successfully, but these errors were encountered: