Last updated: Apr 11, 2024
Reading time·3 min
The Python "AttributeError: type object 'EntryPoints' has no attribute 'get'"
occurs because the importlib-metadata
package has removed the compatibility
shims for the deprecated entry point interfaces starting version 5.0.
To solve the error, pin your importlib-metadata
package to version 4.13.0
.
Open your terminal and run the following command to install the last
importlib-metadata
version prior to version 5.0
.
pip install "importlib-metadata<5.0" # Or with pip3 pip3 install "importlib-metadata<5.0"
If you don't have pip
in your PATH environment variable, you might have to run
the python -m pip
command instead.
python -m pip install "importlib-metadata<5.0" # Or with python3 python3 -m pip install "importlib-metadata<5.0" # py alias (Windows) py -m pip install "importlib-metadata<5.0"
If you use Google Collab or Jupyter Notebook, prefix the command with an exclamation mark.
# 👇️ For Jupyter Notebook !pip install "importlib-metadata<5.0"
You can use the pip show
command to verify that importlib-metadata
has been
downgraded to 4.13.0
.
pip show importlib-metadata # Or with pip3 pip3 show importlib-metadata
If you use a requirements.txt
file, add the following line to pin your
importlib-metadata
version.
importlib-metadata==4.13.0
The line pins the importlib-metadata
package to version 4.13.0
which is the
last version of the package that hasn't removed the entry point interfaces.
If you use the Redash module and the
issue persists, try to pin importlib-metadata
to version 4.12.0
.
pip install importlib-metadata==4.12.0 # Or with pip3 pip3 install importlib-metadata==4.12.0
importlib-metadata
to version 4.13.0
if the issue persistsIf the issue persists, try to explicitly pin the
importlib-metadata package to
version 4.13.0
.
Open your terminal in your project's root directory and run the following command.
pip install importlib-metadata==4.13.0 # Or with pip3 pip3 install importlib-metadata==4.13.0
If you don't have pip
in your PATH environment variable, you might have to run
the python -m pip
command instead.
python -m pip install importlib-metadata==4.13.0 # Or with python3 python3 -m pip install importlib-metadata==4.13.0 # py alias (Windows) py -m pip install importlib-metadata==4.13.0
If you use Google Collab or Jupyter Notebook, prefix the command with an exclamation mark.
# 👇️ For Jupyter Notebook !pip install "importlib-metadata==4.13.0"
You can use the pip show
command to verify that importlib-metadata
has been
downgraded to 4.13.0
.
pip show importlib-metadata # Or with pip3 pip3 show importlib-metadata
If you use a requirements.txt
file, add the following line to pin your
importlib-metadata
version.
importlib-metadata==4.13.0
The line pins the importlib-metadata
package to version 4.13.0
which is the
last version of the package that hasn't removed the entry point interfaces.
The error is also raised if you use an outdated Python version.
Use the python --version
command to verify that you are running a Python
version of 3.9 or higher.
python --version
The error is often caused when you use an outdated Python version, such as 3.7 or older.
Once you pin your importlib-metadata
version to 4.13.0
and use a Python
version of 3.9 or greater, the issue should be resolved.
I've also written detailed articles on:
You can learn more about the related topics by checking out the following tutorials: