0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Pycharmで発生したデバッガ機能の不具合の解決方法(Python3.13)

Last updated at Posted at 2025-04-07

エラー内容

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2023.2\plugins\python-ce\helpers\pydev\_pydevd_bundle\pydevd_trace_dispatch_regular.py", line 408, in __call__
    if not is_thread_alive(t):
           ~~~~~~~~~~~~~~~^^^
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2023.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_is_thread_alive.py", line 18, in is_thread_alive
    return t.isAlive()
           ^^^^^^^^^
AttributeError: '_MainThread' object has no attribute 'isAlive'. Did you mean: 'is_alive'?

エラー状況

Python3.7からPython3.13に移行した際、デバッグ機能がエラーで利用できなくなった。

実行環境

・PyCharm Community Edition 2023.2
・Python3.13
・Windows11

解決方法

①下記のパスのPythonファイルにアクセス
C:\Program Files\JetBrains\PyCharm Community Edition 2023.2\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_is_thread_alive.py

②15行目以降を下記の様に改修し、保存する

pydev_is_thread_alive.py
# 前略
else: 
    # Jython wraps a native java thread and thus only obeys the public API.
    def is_thread_alive(t):
        try:
            r = t.is_alive()
        except:
            r = t.isAlive()
        return r

※もし保存できない場合は以下の手順で保存する。
①エクスプローラーでデスクトップ等にファイルを適当にコピペし、上記の改修を実施。
②元のディレクトリにドラッグ&ドロップし、管理者権限でファイルの上書きを実施。

あとがき

上記の処置でデバッガーが利用できるはずです。
エラーにかかれている内容通りに改修しただけで、もしかすると他機能に影響があるかもしれないので自己責任でお願いいたします。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?