Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ct705 opened this issue Sep 3, 2022 · 1 comment

Comments

@ct705
Copy link

ct705 commented Sep 3, 2022

按照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'

不知道怎么解决?

@ct705
Copy link
Author

ct705 commented Sep 5, 2022

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.
自问自答,解决了自己的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants