amisadmin / fastapi-amis-admin

FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.

Home Page:http://docs.amis.work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

运行报错,提示AttributeError: 'NoneType' object has no attribute 'lower'

ct705 opened this issue · comments

commented

按照Readme文件配置运行,faa run或者 ./scripts/run.sh时均出现以下错误

File "./main.py", line 4, in
from core.adminsite import site
File "./core/init.py", line 1, in
from fastapi_amis_admin import i18n
File "/root/venv/lib/python3.8/site-packages/fastapi_amis_admin/init.py", line 7, in
from .utils.translation import i18n
File "/root/venv/lib/python3.8/site-packages/fastapi_amis_admin/utils/translation.py", line 46, in
i18n = I18N()
File "/root/venv/lib/python3.8/site-packages/fastapi_amis_admin/utils/translation.py", line 11, in init
self._language: str = self.set_language()
File "/root/venv/lib/python3.8/site-packages/fastapi_amis_admin/utils/translation.py", line 27, in set_language
self._language = 'zh_CN' if language.lower().startswith('zh') else 'en_US'
AttributeError: 'NoneType' object has no attribute 'lower'

不知道怎么解决?

commented

The answer is the Language setting, when you execute in the terminal 'env' cmd, you can find there is no LANG option, so you can use cmd' export LANG='zh_CH'' to set the enviorent variable. then the question is get solutons.
自问自答,解决了自己的问题