File "/home/username/.local/lib/python3.7/site-packages/kodi_cli.py", line 3, in import importlib.metadata ModuleNotFoundError: No module named importlib.metadata
pip3 install kodi-cli --user
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: kodi-cli in /home/username/.local/lib/python3.7/site-packages (0.1.9) Requirement already satisfied: requests<3.0.0,>=2.28.0 in /home/username/.local/lib/python3.7/site-packages (from kodi-cli) (2.28.1) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests<3.0.0,>=2.28.0->kodi-cli) (1.24.1) Requirement already satisfied: charset-normalizer<3,>=2 in /home/username/.local/lib/python3.7/site-packages (from requests<3.0.0,>=2.28.0->kodi-cli) (2.0.4) Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests<3.0.0,>=2.28.0->kodi-cli) (2018.8.24) Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests<3.0.0,>=2.28.0->kodi-cli) (2.6)
kodi-cli -H host -P 8080 -u username -p password -C
我把这一错误摆在首位。
pip3 install importlib-metadata --user
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: importlib-metadata in /home/username/.local/lib/python3.7/site-packages (5.0.0) Requirement already satisfied: zipp>=0.5 in /home/username/.local/lib/python3.7/site-packages (from importlib-metadata) (3.10.0) Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /home/username/.local/lib/python3.7/site-packages (from importlib-metadata) (3.10.0.0)
仍有错误。
python3 --version
3.7.3
cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
我在此祝贺我。 希望得到任何帮助。
我怀疑,在“Kkodi_cli.py”方案中,它可能必须这样做。
import importlib.metadata
import json
import logging
import os
import pathlib
import sys
import textwrap
import version as ver_info
from kodi_interface import KodiObj
__version__ = importlib.metadata.version("kodi-cli")