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

Error when importing the 'tmc' module. #71

Open
Observer55 opened this issue Sep 16, 2024 · 0 comments
Open

Error when importing the 'tmc' module. #71

Observer55 opened this issue Sep 16, 2024 · 0 comments

Comments

@Observer55
Copy link

I've done the "own_language" exercise in part 7 -> 6. More Python features . It runs correctly on every test except the exercise called "OwnLanguageTest: test3_all_commands". It says that my program causes on error. I copy the code and try it in an if __name == "main" block and I do not get an error (In some tests (but not in this failed test) my program was throwing maxRecursionError, so when I imported the 'setrecursionlimit' function in 'sys' and called the function with the argument 100000 the problem was solved).
But then I looked at the file 'test_own_language.py' in ...AppData\Local\tmc\vscode\mooc-programming-24*part07-18_own_programming_language\test* I found most of the problem, the file does 'from tmc import points' but for some reason the file can't access or find the init.py in the 'tmc' folder.
The init.py file contains:

from .points import points
from .runner import TMCTestRunner

But when run, it throws this error (even if I comment the first line): ImportError: attempted relative import with no known parent package

And yes, I don't know why this is happening. And my solution to the exercise works fine. When I set the max recursion limit to 100000, almost all tasks run perfectly. But the TestMyCode extension says it fails.
Please help me. I don't know if it's something related to me or to the extension.
And I couldn't find any other solution to this problem on the Internet.
Thanks.

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

1 participant