我是靠谱客的博主 不安黑裤,最近开发中收集的这篇文章主要介绍RuntimeError: Click will abort further execution because Python was configured to use ASCII问题处理:,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

启动flask项目时候,抱错了,如下

raise RuntimeError("nn".join(extra))
RuntimeError: Click will abort further execution because Python was configured to use ASCII as encoding for the environment.

Mac下PyCharm运行Flask报错RuntimeError: Click will abort further

详情:

raise RuntimeError("nn".join(extra))
RuntimeError: Click will abort further execution because Python was configured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/unicode-support/ for mitigation steps.

This system lists some UTF-8 supporting locales that you can pick from. The following suitable locales were discovered: af_ZA.UTF-8, am_ET.UTF-8, be_BY.UTF-8, bg_BG.UTF-8, ca_ES.UTF-8, cs_CZ.UTF-8, da_DK.UTF-8, de_AT.UTF-8, de_CH.UTF-8, de_DE.UTF-8, el_GR.UTF-8, en_AU.UTF-8, en_CA.UTF-8, en_GB.UTF-8, en_IE.UTF-8, en_NZ.UTF-8, en_US.UTF-8, es_ES.UTF-8, et_EE.UTF-8, eu_ES.UTF-8, fi_FI.UTF-8, fr_BE.UTF-8, fr_CA.UTF-8, fr_CH.UTF-8, fr_FR.UTF-8, he_IL.UTF-8, hr_HR.UTF-8, hu_HU.UTF-8, hy_AM.UTF-8, is_IS.UTF-8, it_CH.UTF-8, it_IT.UTF-8, ja_JP.UTF-8, kk_KZ.UTF-8, ko_KR.UTF-8, lt_LT.UTF-8, nl_BE.UTF-8, nl_NL.UTF-8, no_NO.UTF-8, pl_PL.UTF-8, pt_BR.UTF-8, pt_PT.UTF-8, ro_RO.UTF-8, ru_RU.UTF-8, sk_SK.UTF-8, sl_SI.UTF-8, sr_YU.UTF-8, sv_SE.UTF-8, tr_TR.UTF-8, uk_UA.UTF-8, zh_CN.UTF-8, zh_HK.UTF-8, zh_TW.UTF-8

解决办法:

  1. 在 .bash_profile 中添加如下两行——设置编码:
  2. open .bash_profile
  3. export LC_ALL=en_US.utf-8
    export LANG=en_US.utf-8
  4. 执行 source .bash_profile 来让设置生效,
  5. 退出 PyCharm 后再重新打开项目

问题处理:

我mac电脑,像这样配置了环境变量,设置后不生效,此时需要检查mac电脑的配置文件是哪个

  • bash读取的配置文件:~/.bash_profile文件
  • zsh读取的配置文件:~/.zshrc文件

终端输入:echo $SHELL

比如我的电脑是

因此,直接编辑~/.zshrc文件

  • open .zshrc
  • source .zshrc

然后,退出 PyCharm 后再重新打开项目,就可以了

最后

以上就是不安黑裤为你收集整理的RuntimeError: Click will abort further execution because Python was configured to use ASCII问题处理:的全部内容,希望文章能够帮你解决RuntimeError: Click will abort further execution because Python was configured to use ASCII问题处理:所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(43)

评论列表共有 0 条评论

立即
投稿
返回
顶部