Mac下PyCharm运行Flask报错RuntimeError: Click will abort further
报错:
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.
This system lists a couple of UTF-8 supporting locales that
you can pick from. The following suitable locales where
discovered: ..., en_NZ.UTF-8, en_US.UTF-8, ...
- 解决办法:
- 在
.bash_profile中添加如下两行——设置编码:
export LC_ALL=en_US.utf-8
export LANG=en_US.utf-8
- 执行
source .bash_profile来让设置生效, - 退出 PyCharm 后再重新打开项目
本文解决了一个在Mac环境下使用PyCharm运行Flask应用时出现的RuntimeError,该错误源于Python环境配置使用了ASCII编码,而非UTF-8。通过在.bash_profile中设置LC_ALL和LANG环境变量为en_US.utf-8,然后执行source .bash_profile命令,重启PyCharm即可解决问题。
2786

被折叠的 条评论
为什么被折叠?



