AttributeError: '_csv.reader' object has no attribute 'next' 我在使用pyhon3.4运行以下代码时报错:AttributeError:
2017-08-09 16:53
811 查看
AttributeError: '_csv.reader' object has no attribute 'next'
我在使用pyhon3.4运行以下代码时报错:AttributeError: '_csv.reader' object has no attribute 'next'For version 3.2 and above
Change: csv_file_object.next()
To: next(csv_file_object)
then I get another error:
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
Edit: Figured it out needed to change rb to rt
Finally, it works.
REF.
[1]https://www.kaggle.com/c/titanic/forums/t/4937/titanic-problem-with-getting-started-with-python
相关文章推荐
- AttributeError: '_csv.reader' object has no attribute 'next' 使用pyhon3.2以上运行以下代码时报错
- AttributeError: '_csv.reader' object has no attribute 'next'
- AttributeError: '_csv.reader' object has no attribute 'next'
- Python问题:AttributeError: '_csv.reader' object has no attribute 'next' 以及UnicodeDecodeError: 'gbk' co
- python “AttributeError: '_csv.reader' object has no attribute'next'” 报错的解决办法
- AttributeError: '_csv.reader' object has no attribute 'next'
- 执行《机器学习实战》15章代码15-3出现AttributeError: 'MRmean' object has no attribute 'mr'
- 使用vectorizer.fit_transform时出现AttributeError: 'file' object has no attribute 'lower'
- TensorFlow1.0 运行报错 AttributeError: type object 'NewBase' has no attribute 'is_abstract'
- Python2.X与Python3.X编程代码笔记(1):AttributeError: 'dict' object has no attribute 'iteritems'
- AttributeError: 'module' object has no attribute 'reader'
- python 使用 pip 安装 三方库的时候报错 “AttributeError: '_socketobject' object has no attribute...”
- Python 使用sqlite3报错 AttributeError: 'module' object has no attribute 'connect'
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- 使用cx_freeze工具打包时提示 AttributeError 'module' object has no attribute '_fix_up_module':
- web.py 直接使用示例代码,web.application报错, 'module' object has no attribute 'application',问题原因分析
- 使用旧版本tensorflow出现了negative等报错的问题,AttributeError: 'module' object has no attribute 'xxx'"
- Python3.6 下yield的常见错误(AttributeError: 'generator' object has no attribute 'next')
- 关于Srapy框架运行的错误AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'