在python中,我的文件夹结构为:
|myproject
|src
|info
|__init__.py
|information.py
|call
|__init__.py
|call_info.py
代码:
information.py
class myinfo:
def my_acadmics(self):
print('Masters')
def my_earning(self, first, second):
return first+second
def my_address(self,addr):
return addr
call_info.py
from src.info.information import myinfo
obj = myinfo()
print(obj.my_acadmics())
错误:
ModuleNotFoundError:没有名为“ src”的模块
我正在src文件夹中运行它。