How to change the source path of a project?

My project structure is look like this: 

Inside, test2_main.py, 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?

0
3 comments

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

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

Please sign in to leave a comment.