infoMore than 3 years have passed since last update.
Pythonのエラー対処法
Last updated at Posted at 2019-04-21
対処法
- 一番下を見る
- 行を見る
- 対処
コード
- ImportError: No module named
- もしかしたらpip内にあるからインストールしましょう. バージョンに注意
- IndexError: list index out of range
- TypeError: takes exactly (x) arguments ((?) given) (x=必要な引数の数 ?=与えた引数の数)
- NameError: name '-' is not defined
- ValueError: invalid literal for int() with base 10
- 変数でやってるなら中身が文字かも. プログラムの流れをよく見てみよう
- SyntaxError: invalid syntax
- AttributeError: --- instance has no attribute
- AttributeError: class --- has no attribute '---'
- IndentationError: expected an indented block
- TypeError: can only concatenate list (not "int") to list
- str+int, list+str などをやってないか?
- KeyError
- IndexErrorと同じように存在しないやつ
公式ドキュメント
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up