最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python 3.x - ModuleNotFoundError: No module named 'importlib.metadata' (Raspberry pi OS, Picar-x) - Stack Overfl

programmeradmin2浏览0评论

I'm currently trying to run pre-made modules by sunfounder on my raspberry pi via ssh but im getting the error

sudo python3 calibration.py
Traceback (most recent call last):
  File "calibration.py", line 4, in <module>
    import readchar
  File "/usr/local/lib/python3.7/dist-packages/readchar-4.2.1-py3.7.egg/readchar/__init__.py", line 1, in <module>
    import importlib.metadata
ModuleNotFoundError: No module named 'importlib.metadata'

I'm currently using python version 3.7.3, ive tried reinstalling the package by "pip install importlib-metadata" but still doesn't work. It worked for me last week before I reinstalled the OS. I've also tried updating on packages installed by sudo apt update && sudo apt upgrade but still doesnt work. Any ideas on how to fix this

Edit: I've also tried upgrading version of python but it says this: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python3.8 E: Couldn't find any package by glob 'python3.8' E: Couldn't find any package by regex 'python3.8'

I'm currently trying to run pre-made modules by sunfounder on my raspberry pi via ssh but im getting the error

sudo python3 calibration.py
Traceback (most recent call last):
  File "calibration.py", line 4, in <module>
    import readchar
  File "/usr/local/lib/python3.7/dist-packages/readchar-4.2.1-py3.7.egg/readchar/__init__.py", line 1, in <module>
    import importlib.metadata
ModuleNotFoundError: No module named 'importlib.metadata'

I'm currently using python version 3.7.3, ive tried reinstalling the package by "pip install importlib-metadata" but still doesn't work. It worked for me last week before I reinstalled the OS. I've also tried updating on packages installed by sudo apt update && sudo apt upgrade but still doesnt work. Any ideas on how to fix this

Edit: I've also tried upgrading version of python but it says this: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python3.8 E: Couldn't find any package by glob 'python3.8' E: Couldn't find any package by regex 'python3.8'

Share Improve this question edited Mar 5 at 21:04 Sabby asked Mar 5 at 21:00 SabbySabby 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

The stable release of importlib-metadata currently requires Python >=3.9 and the last version to support Python 3.7 was importlib-metadata 6.7.0. You can run pip install importlib-metadata==6.7.0 if using Python 3.7 or upgrade to Python >= 3.9 to use the stable release.

Also note that importlib.metadata was added to the Python standard library since Python 3.8. Therefore you don't have to install it as it now ships with the standard library. See the docs.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论