flask项目导入报ValueError什么意思?,flaskvalueerror,项目结构site|-st
flask项目导入报ValueError什么意思?,flaskvalueerror,项目结构site|-st
项目结构
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试试
编橙之家文章,
相关内容
- 为什么python输出数据时间比C++长,python输出,C语言中,
- Python Scrapy startproject错误异常代码修改求助,scrapystar
- Python access数据库pywintypes.com_error是什么问题,,使用Py
- 如何优化python mongodb批量修改任务,pythonmongodb,有一千万
- Function Annotation在python 2.7中使用有什么注意事项?,ann
- python is引用对象返回结果为何不同,pythonis引用对象,
- 获取字典中的url报错No such file or directory什么问题,ur
- object.__setattr__和直接设置Python属性有什么不一样?,
- python中flask celery配置结构出错求解,flaskcelery,脚手架是
- Python beautifulsoup方法得到input中value的方式是什么?,,H
评论关闭