LoginSignup
15
12

More than 3 years have passed since last update.

PythonのError一覧

Last updated at Posted at 2019-05-15

随時加筆

ErrorType Errorの例 Errorの原因
SyntaxError invalid syntax 構文の間違い。スペルミス、:がない、など
文字列の中に”や’が含まれている。\(エスケープ文字)で対処可能
keyword can't be an expression 計算式が間違っている
unexpected EOF while parsing 括弧がない
positional argument follow keyword argument カンマとピリオドの間違い、スペルミス
non-default argument follows default argument 関数の引数に初期値がない
TypeError can only concatenate list (not "str") to list print関数の中身はデータの型を合わせなければならない
must be str, not int int型は使えない、str型でなければならない
get_name() takes 0 positional arguments but 1 was given 第一引数のselfを忘れている
predict() takes 2 positional arguments but 3 were given 関数に余分な引数が設定されている
'tuple' object does not support item assignment タプルの要素は変更できない
NameError name 'list_4' is not defined list_4は定義されていない
IndentationError expected an indented block インデントが不正
unexpected indent インデントが不正
IndexError list index out of range リストのサイズを超えたインデックスの要素を参照しようとしている。
ModuleNotFoundError No module named 'matplotolib' モジュールの名前を間違えている
AttributeError module 'matplotlib.pyplot' has no attribute 'sccater' スペルミス
ValueError Expected 2D array, got 1D array instead 括弧の位置がおかしい、カンマがないなど
sabsring not found 文字列に含まれていない文字を検索した
15
12
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
15
12