SHR
SHR

Reputation: 496

Files' hierarchy in pycharm leads to error

The attached image is to show the file hierarchy. No problem with the code. I'm trying to create a simple class testing but when I run post_test.py, I'm getting an error: ModuleNotFoundError: No module named 'post' I'm not sure what is wrong with the hierarchy of the files and why it cannot find the class. enter image description here

Upvotes: 0

Views: 30

Answers (1)

user11058269
user11058269

Reputation: 51

in post_test.py, try replacing

from post import Post

with

from blog.post import Post

Upvotes: 1

Related Questions