簡體   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