Translated message

A translation of this page exists in English.

RHEL gdb 命令失败并显示错误信息 Fatal Python error:Py_Initialize:Unable to get the locale encoding

Solution In Progress - Updated -

Issue

  • 运行 GNU Debugger 命令 gdb 失败并显示以下错误。

    $ gdb
    Fatal Python error: Py_Initialize: Unable to get the locale encoding
      File "/usr/lib64/python2.7/encodings/__init__.py", line 123
        raise CodecRegistryError,\
                                ^
    SyntaxError: invalid syntax
    
    Current thread 0x00007fb99529dbc0 (most recent call first):
    Aborted
    

Environment

  • Red Hat Enterprise Linux 8
  • Python 2.7.17

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content