AttributeError: module 'sys' has no attribute 'setdefaultencoding'

エラーAttributeError

エラーメッセージ

 状態:-  閲覧数:986  投稿日:2017-10-28  更新日:2017-11-11  
モジュール 'sys'には属性 'setdefaultencoding'がありません
[error] AttributeError: module 'sys' has no attribute 'setdefaultencoding', referer:


エラー原因


Python3のモジュール 'sys'には、属性 'setdefaultencoding'は存在しない
・Python3未満では、デフォルトエンコーディングをutf-8へ変更するため、下記のような書き方をしていた
・Python3はデフォルトがutf-8なので、下記設定は不要
import sys
sys.setdefaultencoding("utf-8")



AttributeError: ResultSet object has no attribute 'attrs'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?

AttributeError: type object 'datetime.datetime' has no attribute 'datetime'

コメント投稿(ログインが必要)