python - Python 错误出现在 Rust Cargo 中
问题描述
当我出于某种原因尝试使用 Cargo 运行库示例时,会出现 Python 错误。我不知道为什么或如何发生这种情况,有人认为他们可能知道如何解决这个问题吗?
cargo run --example lib_example
module 'json' has no attribute 'JSONDecodeError'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 117, in get_snaps
snaps = json.loads(output)
AttributeError: module 'json' has no attribute 'loads'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 23, in crash_guard
callback()
File "/usr/lib/command-not-found", line 95, in main
if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 364, in advise
snaps, mispell_snaps = self.get_snaps(command)
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 118, in get_snaps
except json.JSONDecodeError as e:
AttributeError: module 'json' has no attribute 'JSONDecodeError'
解决方案
我不知道为什么,但which
为了货物而跑然后重新启动以某种方式修复它。
which cargo
sudo reboot
推荐阅读
- sparql - SPARQL:如何从 dbpedia 检索所有犬种及其所有信息框数据?
- excel - 使用数组向表中添加新行 - 关于公式的问题
- .net - 如何投射 Vector128
进入 Vector128 在.NET 中? - android - Kotlin:等待 Async 调用完成,然后为 var 赋值,然后返回
- azure-devops - 根据 azure devops 上的参数运行任务
- go - 如何在 uber/zap 记录器中动态更改日志级别
- video - 使用ffmpeg随机裁剪带有时间变量(t)的视频?
- regex - 正则表达式匹配字母数字字符,只允许下划线出现在中间
- django-urls - 实际上,Django 中 urls.py 中 URL 模式的评估顺序是什么?
- rust - 在默认特征实现中使用关联常量