• 6d2e343ce9a54c4c82666d717c4b0781_image.png
    我把 if sys.flags.utf8_mode 分支注释了之后又报了这个错

  • 这是我的 _bootlocale.py 文件

    """A minimal subset of the locale module used at interpreter startup
    (imported by the _io module), in order to reduce startup time.

    Don’t import directly from third-party code; use the locale module instead!
    """

    import sys
    import _locale

    if sys.platform.startswith(“win”):
    def getpreferredencoding(do_setlocale=True):
    if sys.flags.utf8_mode:
    return ‘UTF-8’
    return _locale._getdefaultlocale()[1]
    else:
    try:
    _locale.CODESET
    except AttributeError:
    if hasattr(sys, ‘getandroidapilevel’):
    # On Android langinfo.h and CODESET are missing, and UTF-8 is
    # always used in mbstowcs()and wcstombs().
    def getpreferredencoding(do_setlocale=True):
    return ‘UTF-8’
    else:
    def getpreferredencoding(do_setlocale=True):
    if sys.flags.utf8_mode:
    return ‘UTF-8’
    # This path for legacy systems needs the more complex
    # getdefaultlocale() function, import the full locale module.
    import locale
    return locale.getpreferredencoding(do_setlocale)
    else:
    def getpreferredencoding(do_setlocale=True):
    assert not do_setlocale
    if sys.flags.utf8_mode:
    return ‘UTF-8’
    result = _locale.nl_langinfo(_locale.CODESET)
    if not result and sys.platform == ‘darwin’:
    # nl_langinfo can return an empty string
    # when the setting has an invalid value.
    # Default to UTF-8 in that case because
    # UTF-8 is the default charset on OSX and
    # returning nothing will crash the
    # interpreter.
    result = ‘UTF-8’
    return result

  • 感谢解答!我把系统设置的 Python 环境变量全部删掉之后,程序就可以正常运行了。但是我电脑其他的 python 程序就没法跑了 😐 求问有没有为 RPA 设计器单独设置环境变量的方法呢?再次感谢

nbqy3822ft
  • 0 标签
  • 1 帖子
  • 3 回帖

个人主页