Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'importlib.metadata'

I'm trying to install Odoo 15.0 on mac (python 3.7) when i come to run the command:

pip3 install -r requirements.txt

I got this error message:

Traceback (most recent call last):
File "/usr/local/opt/[email protected]/bin/pip3", line 10, in <module>
from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'
like image 958
Omri Maher Avatar asked Dec 12 '25 06:12

Omri Maher


2 Answers

Try installing this lib manually, using :

pip install importlib-metadata

or

pip3 install importlib-metadata

like image 101
Omar Tougui Avatar answered Dec 14 '25 21:12

Omar Tougui


Note that while the accepted answer was relevant for the specific version of Python used in the question (3.7 or older), and asked at the moment of asking, now it has become obsolete, because Python 3.7 has since reached its end-of-life.

Since Python 3.8 the importib-metadata third-party library has been merged into CPython and became its importlib.metadata module, so it is now possible to use it like this:

from importlib.metadata import distribution,metadata,version
like image 41
mirekphd Avatar answered Dec 14 '25 19:12

mirekphd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!