python - 自动更正python3包错误TypeError:JSON对象必须是str,而不是'bytes'
问题描述
我使用命令pip install autocorrect安装了自动更正包,所有安装正确,但示例代码:
from autocorrect import Speller
check = Speller(lang='en')
check("does this sentece have misspelled wordz?")
给我这个包文件中的错误:
回溯(最后一次调用):文件“D:\abk\study\testauto.py”,第 3 行,检查 = Speller(lang='en') 文件“C:\Users\Abdelrahman Bonna\AppData\Local\ Programs\Python\Python35-32\lib\site-packages\autocorrect__init__.py”,第 58 行,在init self.nlp_data = load_from_tar(lang) 文件“C:\Users\Abdelrahman Bonna\AppData\Local\Programs\Python\ Python35-32\lib\site-packages\autocorrect__init__.py”,第 52 行,在 load_from_tar 返回 json.load(file) 文件“C:\Users\Abdelrahman Bonna\AppData\Local\Programs\Python\Python35-32\lib \json__init__.py”,第 268 行,加载 parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) 文件“C:\Users\Abdelrahman Bonna\AppData\Local\Programs\Python\Python35-32\lib\json__init__.py",第 312 行,加载 s。类。name )) TypeError:JSON 对象必须是 str,而不是 'bytes'
我在这个包中使用 python 3.5 并破坏了 Windows 10。
解决方案
推荐阅读
- php - CF7 左修剪在发送电子邮件操作挂钩之前
- r - 列出工作目录中的前 n 个文件
- r - 无法与官员更改 PPT 标题字体
- java - batchUpdate Spring 4 + OpenJDK11 + MySQL 性能缓慢
- office-js - Outlook Web 加载项关闭时的事件
- android - Flutter :- PageView Image 内部没有设置为适合屏幕的宽度?
- iis - 如何显示自定义错误页面而不是 iis 403 错误页面?
- android - 使用 Gif 图像自定义进度条在某些设备上无法正常工作
- php - 在 laravel 上使用查询格式化嵌套 json
- clojure - Clojure:将映射数组转换为:key val 序列