#p.py
from q import test
def testp():
test()
print('in p.py')
#q.py
def test():
print('in q.py')
运行main.py,就会出现ImportError: No module named q
这个如何解决?谢
...全文
17911打赏收藏
python的包的问题
在import的时候出现ImportError: No moudule named q 目录结构如下 src/ ---main.py ---a/ ------__init__.py ------q.py ------p.py #main.py from a import p p.testp() #p.py from q import test def testp(): test() print('in p.py') #q.py def test(): print('in q.py') 运行mai