繁体   English   中英

Python 错误出现在 Rust Cargo

[英]Python errors show up with 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 for cargo 然后重新启动以某种方式修复它。

which cargo
sudo reboot

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM