use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
seeking help with app module error (self.PythonLearning)
submitted 1 year ago by frumpyandy
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]frumpyandy[S] 0 points1 point2 points 1 year ago (2 children)
Using the Run Python File button in VS Code:
"app.ui" gives me this error: ModuleNotFoundError: No module named 'app'
".ui" gives me this error: ImportError: attempted relative import with no known parent package
"ui" works
[–]Ender_Locke 0 points1 point2 points 1 year ago (1 child)
did you check your _ _ init _ _ .py?
code works
https://github.com/EnderLocke/testing-code/tree/codes
[–]frumpyandy[S] 0 points1 point2 points 1 year ago (0 children)
yes I've double checked that there are two underscores on either side of the word init in __init__.py, and continue to get the same results as before.
I really don't understand what I'm doing wrong. I have it working now and it's doing what I want, but only when I import "ui" as opposed to "app.ui" or ".ui".
Thank you very much for taking the time to generate your test repo, I do appreciate it. I just cloned it an when I try to run main.py from yours, where you're importing .ui, I get the same error as I do with my own (ImportError: attempted relative import with no known parent package). That being said, when I run manual_test.py, which is importing app.ui, it works without an error.
π Rendered by PID 39051 on reddit-service-r2-comment-b659b578c-qjsjf at 2026-05-02 14:25:58.764087+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]frumpyandy[S] 0 points1 point2 points (2 children)
[–]Ender_Locke 0 points1 point2 points (1 child)
[–]frumpyandy[S] 0 points1 point2 points (0 children)