Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Incompatibility with Python 3.13: AttributeError for 'pkgutil.ImpImporter' #4817

Open
EsetaL10 opened this issue Feb 1, 2025 · 1 comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@EsetaL10
Copy link

EsetaL10 commented Feb 1, 2025

setuptools version

setuptools 75.8.0

Python version

python 3.13

OS

windows 10

Additional environment information

Description

When using Python 3.13 with setuptools, numpy, and librosa, I encountered the following error:
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

This occurs because Python 3.13 has removed ImpImporter, but libraries like setuptools (even recent versions) still rely on it. This causes installation failures for numpy downgrades and breaks compatibility with librosa, pretty_midi, and music21.

Expected behavior

Libraries should install and import without errors.

How to Reproduce

  1. Install Python 3.13.
  2. Run: pip install librosa numpy==1.23.5 scipy matplotlib mido pretty_midi music21 mir_eval
  3. Import the libraries in Python: import setuptools, librosa, numpy

Output

The process fails with the pkgutil.ImpImporter error.

@EsetaL10 EsetaL10 added bug Needs Triage Issues that need to be evaluated for severity and status. labels Feb 1, 2025
@Avasam
Copy link
Contributor

Avasam commented Feb 1, 2025

Could you post the full error with complete trace ?
setuptools doesn't use pkgutil directly outside of pkg_resources. And all ImpImporter accesses are protected by if hasattr(pkgutil, 'ImpImporter').

As a guess, it's possible the error comes from an outdated dependency of setuptools that you may have laying around.
Can you try pip install --upgrade setuptools[core] ? as per https://setuptools.pypa.io/en/latest/userguide/quickstart.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

2 participants