TypeError: write() argument must be str, not bytes
程序员文章站
2024-02-21 23:17:34
...
报错信息如下
报错原因
这个open(path,'w')是python2写入文件的写法,python3不是这样的
解决方案
把'w'改成'wb'
pickle.dump(gmm,open(dest+picklefile,'wb'))
上一篇: Linux error while loading shared libraries: cannot open shared object file: No such file or director
下一篇: [Python] TypeError: write() argument must be str, not bytes
推荐阅读
-
python write() argument must be str, not bytes
-
TypeError: write() argument must be str, not bytes
-
TypeError: write() argument must be str, not bytes
-
[Python] TypeError: write() argument must be str, not bytes
-
TypeError: argument 1 must be 2-item sequence, not int
-
pytorch gpu版本安装外部库报错 TypeError: LoadLibrary() argument 1 must be str, not None
-
TypeError: transpose(): argument 'dim0' (position 1) must be int, not tuple
-
解决报错:TypeError: argument should be integer or bytes-like object, not ‘str‘
-
TypeError: join() argument must be str or bytes, not ‘PosixPath‘
-
编译安卓源码提示:TypeError: argument should be integer or bytes-like object, not ‘str‘