PyCharmのデバッグ機能が使えなくなった件

デバッグ使えないとやる気でない勢なのでいろいろ再インストールしたけど無理だった。結局、packageの中のスクリプトだと無理ってことが分かった

結論

__init__.pyがあると駄目みたいです。

対処法

__init__.pyを削除すること。

症状


D:\python\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp, sys, os
D:\python\lib\importlib\_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\_pydevd_bundle\pydevd_cython_wrapper.py", line 2, in 
    from _pydevd_bundle_ext.pydevd_cython import trace_dispatch, PyDBAdditionalThreadInfo, global_cache_skips, global_cache_frame_skips
ModuleNotFoundError: No module named '_pydevd_bundle_ext'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\pydevconsole.py", line 8, in 
    from code import InteractiveConsole
ImportError: cannot import name 'InteractiveConsole'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\pydevd.py", line 28, in 
    from _pydevd_bundle.pydevd_additional_thread_info import PyDBAdditionalThreadInfo
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\_pydevd_bundle\pydevd_additional_thread_info.py", line 17, in 
    from _pydevd_bundle.pydevd_cython_wrapper import PyDBAdditionalThreadInfo
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\_pydevd_bundle\pydevd_cython_wrapper.py", line 32, in 
    mod = __import__(check_name)
  File "_pydevd_bundle\pydevd_cython_win32_36_32.pyx", line 139, in init _pydevd_bundle.pydevd_cython_win32_36_32
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\_pydevd_bundle\pydevd_breakpoints.py", line 16, in 
    from _pydevd_bundle.pydevd_comm import get_global_debugger
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 76, in 
    import pydevconsole
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\pydevconsole.py", line 10, in 
    from _pydevd_bundle.pydevconsole_code_for_ironpython import InteractiveConsole
  File "C:\Program Files\JetBrains\PyCharm 2018.1.3\helpers\pydev\_pydevd_bundle\pydevconsole_code_for_ironpython.py", line 105
    except SyntaxError, err:
                      ^
SyntaxError: invalid syntax

デバッガを起動するとこういうエラーが出てきてデバッグしてくれません。パッケージの中にあると駄目みたいなので、__init__.pyを削除しましょう。

やったこと

  • Pythonの再インストール ×
  • PyCharmの再インストール ×

泣ける

[amazonjs asin=”4873117569″ locale=”JP” tmpl=”Small” title=”Effective Python ―Pythonプログラムを改良する59項目”]

コメントを残す

メールアドレスが公開されることはありません。