エラーコードポータル
PythonPythonエラーコード

SyntaxError

SyntaxError

コード SyntaxError · Pythonが報告した問題です。

パーサーが構文エラーを検出したときに発生します。これは、import ステートメント、組み込み関数 COMPILE()、exec()、または eval() の呼び出し、または初期スクリプトまたは標準入力 (対話形式でも) を読み取るときに発生する可能性があります。 例外インスタンスの str() は、エラー メッセージのみを返します。詳細はタプルであり、そのメンバーは個別の属性としても使用できます。

Google Translate · 自動翻訳です。専門用語や適用条件は英語の原文で確認してください。

Raised when the parser encounters a syntax error. This may occur in an import statement, in a call to the built-in functions compile(), exec(), or eval(), or when reading the initial script or standard input (also interactively). The str() of the exception instance returns only the error message. Details is a tuple whose members are also available as separate attributes.

トラブルシューティング・診断リンク

まず、文書の製品・バージョン・発生環境が現在の状況と一致しているか確認してください。