How to change the source path of a project?

My project structure is look like this: 

Inside,, I run "from test1 import x", however, 

Traceback (most recent call last):
    from test1 import x
ModuleNotFoundError: No module named 'test1'

I do want to input in this way, how can I solve it?

Comment actions Permalink

I tired to change test1 as the working directory, but it didn't work

Comment actions Permalink
Instead of setting the working directory, please click on `python` directory and select "Mark as >> Source root".

Please sign in to leave a comment.