AttributeError:模块'dis'没有属性'_unpack_opargs'

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AttributeError:模块'dis'没有属性'_unpack_opargs'相关的知识,希望对你有一定的参考价值。

File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_comm\pydev_server.py", line 34, in handle
    self.processor.process(iprot, oprot)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\third_party\thriftpy\_shaded_thriftpy\thrift.py", line 266, in process
    self.handle_exception(e, result)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\third_party\thriftpy\_shaded_thriftpy\thrift.py", line 254, in handle_exception
    raise e
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\third_party\thriftpy\_shaded_thriftpy\thrift.py", line 263, in process
    result.success = call()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\third_party\thriftpy\_shaded_thriftpy\thrift.py", line 228, in call
    return f(*(args.__dict__[k] for k in api_args))
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_console_utils.py", line 304, in loadFullValue
    from _pydev_bundle.pydev_console_commands import ThriftGetValueAsyncThreadConsole
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_console_commands.py", line 2, in <module>
    from _pydevd_bundle.pydevd_comm import PyDBDaemonThread
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 96, in <module>
    from _pydevd_bundle import pydevd_bytecode_utils
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_bytecode_utils.py", line 105, in <module>
    _unpack_opargs = dis._unpack_opargs
AttributeError: module 'dis' has no attribute '_unpack_opargs'

[每当我在pycharm中打开python控制台时,iam都会报错。我试图从位于“ C:\ Users \ username \ AppData \ Local \ Programs \ Python \ Python35 \ Lib \ dis.py”中的python dis.py查找错误,但未找到“ _unpack_opargs”函数。实际上是从python文件的位置调用的:“ C:\ Program Files \ JetBrains \ PyCharm Community Edition 2020.1 \ plugins \ python-ce \ helpers \ pydev_pydevd_bundle \ pydevd_bytecode_utils.py”。请帮助摆脱此问题。

实际上,我想的是,上述情况与AttributeError: module 'dis' has no attribute '_unpack_opargs' While Building Python 3.6 executable using CX_FREEZE帖子

答案
if IS_PY3K:
    long = int

try:
    _unpack_opargs = dis._unpack_opargs
except AttributeError:
    def _unpack_opargs(code):
       n = len(code)

步骤:

  1. 删除
_unpack_opargs = dis._unpack_opargs

if条件中的行。2.删除else条件并替换为try缓存,类似于上面的代码。

以上是关于AttributeError:模块'dis'没有属性'_unpack_opargs'的主要内容,如果未能解决你的问题,请参考以下文章

AttributeError:模块'tensorflow'没有属性'__version __'

AttributeError:模块'django.contrib.auth.views'没有属性'LoginView'

AttributeError:模块'theano'没有属性'ifelse'

AttributeError:模块'win32ctypes.pywin32.win32api'没有属性'错误'

AttributeError:模块'tensorflow'没有带Ke ras的属性'name_scope'

解决AttributeError:模块'pandas'没有使用command-prompt或pycharm属性'core'