--- title: "Python" url: https://docs.catalyst.zoho.com/ja/tools/tunneling/implementation/ide-config/python/ description: "Catalyst Tunnelingは、リバースプロキシプロバイダーのTunneling URLを使用して、関数呼び出しをローカルシステムにルーティングすることで、非HTTPSおよびIntegration関数をデバッグできます。" last_updated: 2026-08-17T12:16:04Z service: All Services type: general --- # Python関数のデバッグ用IDE設定 このヘルプドキュメントでは、Visual Studio CodeでPythonの非HTTPSおよびIntegration関数のデバッグ設定を行う方法を説明します。 > **注意:** この手順は、**トンネリング済み関数をデバッグしたい**場合にのみ適用され、以下のCLIコマンドを使用している場合に該当します: ```sh catalyst functions:shell --tunnel tunnel-port-number --debug port-number ``` 関数のトンネリングのみを行い、以下のCLIコマンドを使用している場合は、IDE設定は不要です。 ```sh catalyst functions:shell --tunnel tunnel-port-number ``` このコマンドは**関数をトンネリングするのみ**で、関数のログをCatalyst CLIに出力します。 VS Code IDEのデバッガーを以下の方法で設定します: 1. デバッグが必要なすべての関数がローカルマシンにあることを確認し、該当するプロジェクトをVS Codeで開きます。 ![catalyst_tunneling_debug_vscode_python_openprojec](https://catalyst-docs-development.zohostratus.in/images/catalyst-extension/tunneling/catalyst_tunneling_debug_vscode_python_openprojec.webp) 2. メニューバーの**Run/Debug**ボタンをクリックし、「**create a launch.json file**」オプションをクリックして`launch.json`ファイルを作成します。 ![catalyst_tunneling_vscode_debug_create_json_high](https://catalyst-docs-development.zohostratus.in/images/catalyst-extension/tunneling/catalyst_tunneling_vscode_debug_create_json_high.webp) 設定を開始する前のlaunch.jsonファイルの表示は以下のとおりです。 ![catalyst_tunneling_vscode_debug_create_json_high](https://catalyst-docs-development.zohostratus.in/images/catalyst-extension/tunneling/catalyst_tunneling_vscode_debug_create_json_high.webp) 3. 以下のJSONスニペットをコピーし、「**configurations**」JSONキーの値として貼り付けます。 **launch.json** ```json "configurations":[{ "name": "Python: Current File", "type": "debugpy", "request": "attach", "connect": { "host": "127.0.0.1", "port": 9001 //the debug port number which you have specified in the catalyst functions:shell --tunnel 8001 --debug 9001. }, "justMyCode": true }], ``` 4. Visual Studio Code IDEでPython関数をデバッグするために、**Python Debugger** VS Code拡張機能をインストールします。 ![catalyst_tunneling_config_ide_python_debugger_extension install](https://catalyst-docs-development.zohostratus.in/images/catalyst-extension/tunneling/catalyst_tunneling_config_ide_python_debugger_extension install.webp) 5. 以下のコマンドを使用して、Python関数のソースディレクトリに[debugpy](https://pypi.org/project/debugpy/)をインストールします: ```sh python3.9 -m pip install debugpy -t ./ ``` ![catalyst_tunneling_vscode_debug_install_python_debuggy](https://catalyst-docs-development.zohostratus.in/images/catalyst-extension/tunneling/catalyst_tunneling_vscode_debug_install_python_debuggy.webp) 6. 以下のコード行をコピーし、関数コードの冒頭に貼り付けます: **code_file.py** ```python import debugpy debugpy.listen(9001) #specify the port for debugging print("Waiting for debugger to attach") debugpy.wait_for_client() print("debugger attached") ``` 7. メインのPythonコードファイルの任意の場所で`debugpy.breakpoint()`関数を使用してブレークポイントを設定します。 ![catalyst_tunneling_vscode_debugging_with_debugger](https://catalyst-docs-development.zohostratus.in/images/catalyst-extension/tunneling/catalyst_tunneling_vscode_debugging_with_debugger.webp)