美文网首页
Python 3 was configured to use A

Python 3 was configured to use A

作者: liwen2015 | 来源:发表于2018-09-12 13:20 被阅读103次

    py2 执行py3的script会报错

    err info: Traceback (most recent call last):
      File "/home/zhangwm/Software/ebola_jig/trec-dd-jig/jig/jig.py", line 81, in <module>
        main()
      File "/home/zhangwm/Software/anaconda2/envs/anaconda_py3/lib/python3.6/site-packages/click/core.py", line 716, in __call__
        return self.main(*args, **kwargs)
      File "/home/zhangwm/Software/anaconda2/envs/anaconda_py3/lib/python3.6/site-packages/click/core.py", line 675, in main
        _verify_python3_env()
      File "/home/zhangwm/Software/anaconda2/envs/anaconda_py3/lib/python3.6/site-packages/click/_unicodefun.py", line 119, in _verify_python3_env
        'mitigation steps.' + extra)
    RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment.  Either run this under Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.
     
    This system lists a couple of UTF-8 supporting locales that
    you can pick from.  The following suitable locales where
    discovered: aa_DJ.utf8, aa_ER.utf8, aa_ET.utf8, af_ZA.utf8, am_ET.utf8, an_ES.utf8, ar_AE.utf8, ar_BH.utf8, ar_DZ.utf8, ar_EG.utf8, ar_IN.utf8, ar_IQ.utf8, ar_JO.utf8, ar_KW.utf8, ar_LB.utf8, ar_LY.utf8, ar_MA.utf8, ar_OM.utf8, ar_QA.utf8, ar_SA.utf8, ar_SD.utf8, ar_SY.utf8, ar_TN.utf8, ar_YE.utf8, as_IN.utf8, ast_ES.utf8, ayc_PE.utf8, az_AZ.utf8, be_BY.utf8, bem_ZM.utf8, ber_DZ.utf8, ber_MA.utf8, bg_BG.utf8, bho_IN.utf8, bn_BD.utf8, bn_IN.utf8, bo_CN.utf8, bo_IN.utf8, br_FR.utf8, brx_IN.utf8, bs_BA.utf8, byn_ER.utf8, ca_AD.utf8, ca_ES.utf8, ca_FR.utf8, ca_IT.utf8, crh_UA.utf8, cs_CZ.utf8, csb_PL.utf8, cv_RU.utf8, cy_GB.utf8, da_DK.utf8, de_AT.utf8, de_BE.utf8, de_CH.utf8, de_DE.utf8, de_LU.utf8, doi_IN.utf8, dv_MV.utf8, dz_BT.utf8, el_CY.utf8, el_GR.utf8, en_AG.utf8, en_AU.utf8, en_BW.utf8, en_CA.utf8, en_DK.utf8, en_GB.utf8, en_HK.utf8, en_IE.utf8, en_IN.utf8, en_NG.utf8, en_NZ.utf8, en_PH.utf8, en_SG.utf8, en_US.utf8, en_ZA.utf8, en_ZM.utf8, en_ZW.utf8, es_AR.utf8, es_BO.utf8, es_CL.utf8, es_CO.utf8, es_CR.utf8, es_CU.utf8, es_DO.utf8, es_EC.utf8, es_ES.utf8, es_GT.utf8, es_HN.utf8, es_MX.utf8, es_NI.utf8, es_PA.utf8, es_PE.utf8, es_PR.utf8, es_PY.utf8, es_SV.utf8, es_US.utf8, es_UY.utf8, es_VE.utf8, et_EE.utf8, eu_ES.utf8, fa_IR.utf8, ff_SN.utf8, fi_FI.utf8, fil_PH.utf8, fo_FO.utf8, fr_BE.utf8, fr_CA.utf8, fr_CH.utf8, fr_FR.utf8, fr_LU.utf8
    

    解决:执行命令前加上:

    export LC_ALL=en_US.utf-8 && export LANG=en_US.utf-8   &&  python xx.py
    
    

    或者直接python3 xx.py

    相关文章

      网友评论

          本文标题:Python 3 was configured to use A

          本文链接:https://www.haomeiwen.com/subject/pojvgftx.html