我尝试在 ubuntu18.04 中的 docker 中部署我的烧瓶应用程序,并且我在我的 pipenv 中使用了 python3.5。但是当我运行时docker build -t flask .,在一个步骤中RUN pipenv install,我收到了这个错误:
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/en/7.x/python3/ for mitigation steps.
This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
Run Code Online (Sandbox Code Playgroud)
但是当我检查我的语言环境时locale,它返回了
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8" …Run Code Online (Sandbox Code Playgroud) 几个小时以来,我的代码遇到了一些问题。
我确定这是由循环导入问题引起的,但我还有另一个问题。
我有两个蓝图,auth 和 main。我只是在render_template没有任何数据传递的情况下返回一个,一切都很顺利。但是当我尝试在我的 shwo 中显示某些内容时main.index,突然发生了错误。
我想知道为什么它在auth.views存在循环导入问题的情况下运行良好?
我的树结构
app
|- auth
|- __init__.py
|- forms.py
|- views.py
|- main
|- __init__.py
|- forms.py
|- views.py
|- template
|- __init__.py
|- models.py
config.py
manage.py
datta.sqlite
Run Code Online (Sandbox Code Playgroud)
在auth.__init__.py:
app
|- auth
|- __init__.py
|- forms.py
|- views.py
|- main
|- __init__.py
|- forms.py
|- views.py
|- template
|- __init__.py
|- models.py
config.py
manage.py
datta.sqlite
Run Code Online (Sandbox Code Playgroud)
并在 auth.views.py
from app.auth import auth
from app.models import * …Run Code Online (Sandbox Code Playgroud)