项目结构
site |-static |-templates |-account |-__init__.py |-views.py |-run.py |-sqlhelper.py
从account/views.py导入sqlhelper的所有内容from ..sqlhelper import *
报错:ValueError: attempted relative import beyond top-level package
我搜索了这个错误信息,但是看不太明白,不知道怎么修改。
所以要请教一下大家怎么办
相对导入和绝对导入都是针对包内来说的,将site目录下加入__init__.py
试试