【发布时间】:2020-12-19 20:29:11
【问题描述】:
我有以下文件夹结构:
src
|_ __init__.py
example.py
test
|_ test.py
# __init__.py
class API:
def something(self):
print('folder src | file __init__')
# example.py
class Example:
def doingSomething(self):
print('folder src | file example')
# test.py
import src
from src.example import Example
class Test:
def somethingElse(self):
print('folder test | file test')
当我运行test.py 文件时,我收到以下错误:
Traceback (most recent call last):
File "<my path>\test\test.py", line 1, in <module>
import src
ModuleNotFoundError: No module named 'src'
【问题讨论】:
标签: python