python / importlib_metadata

Library to access metadata for Python packages
https://importlib-metadata.readthedocs.io
Apache License 2.0
123 stars 80 forks source link

TypeError: entry_points() got an unexpected keyword argument 'group' #421

Closed hemna closed 1 year ago

hemna commented 1 year ago

Trying to run entry_points(group="oslo.cofig.opts") fails with

TypeError: entry_points() got an unexpected keyword argument 'group

Documentation says group is a valid kwarg to pass in https://docs.python.org/3/library/importlib.metadata.html#entry-points

└─> python --version
Python 3.9.2
└─> pip freeze |grep importlib
importlib-metadata==5.2.0
importlib-resources==5.10.1

I have tried with importlib-metadata==6.0.0 as well.

jaraco commented 1 year ago

Indeed, entrypoints accepts kw args. If you're getting that error, you're not actually importing entry_points from importlib_metadata 3.6 or later. You're probably getting entry_points from Python 3.9 importlib.metadata or maybe importlib_metadata<3.6.

Double-check your import. If it's importlib_metadata, double-check importlib_metadata.__file__ and verify it's importing from the location where importlib-metadata==5.2.0 is installed.