0

I have a file structure like this

└── myproject ├── src ├── a.py ├── b.py 

module a contains a class that is imported in by module b like this:

from src.a import some_class 

when I try to import b from another class:

from myproject.src import b 

I get this error:

from src.a import some_class ModuleNotFoundError: No module named 'src' 

why can't python find package src? how can I solve this?

1 Answer 1

1

You can try this import in b.py

from .a import some_class 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.