mim icon indicating copy to clipboard operation
mim copied to clipboard

Not compatible with Python 3.12

Open sbhavani opened this issue 11 months ago • 2 comments

Describe the bug A clear and concise description of what the bug is.

Reproduction

  1. What command or script did you run?
pip install openmim

Environment

Using Python 3.12 (nvcr.io/nvidia/pytorch:24.12-py3)

Error traceback If applicable, paste the error trackback here.

5.071   × python setup.py egg_info did not run successfully.
5.071   │ exit code: 1
5.071   ╰─> [11 lines of output]
5.071       Traceback (most recent call last):
5.071         File "<string>", line 2, in <module>
5.071         File "<pip-setuptools-caller>", line 14, in <module>
5.071         File "/usr/local/lib/python3.12/dist-packages/setuptools/__init__.py", line 16, in <module>
5.071           import setuptools.version
5.071         File "/usr/local/lib/python3.12/dist-packages/setuptools/version.py", line 1, in <module>
5.071           import pkg_resources
5.071         File "/usr/local/lib/python3.12/dist-packages/pkg_resources/__init__.py", line 2191, in <module>
5.071           register_finder(pkgutil.ImpImporter, find_on_path)
5.071                           ^^^^^^^^^^^^^^^^^^^
5.071       AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
5.071       [end of output]
5.071   
5.071   note: This error originates from a subprocess, and is likely not a problem with pip.
5.539 error: metadata-generation-failed
5.539 
5.539 × Encountered error while generating package metadata.
5.539 ╰─> See above for output.
5.539 
5.539 note: This is an issue with the package mentioned above, not pip.
5.539 hint: See above for details.
------
Dockerfile:6
--------------------
   4 |     RUN pip install setuptools==65.5.1
   5 |     
   6 | >>> RUN pip install openmim
   7 |     RUN mim install mmengine 
   8 |     RUN mim install "mmcv>=2.0.0"
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install openmim" did not complete successfully: exit code: 1

Bug fix pkgutil.ImpImporter is deprecated and removed in newer Python versions

sbhavani avatar Jan 11 '25 01:01 sbhavani

Yes, please update mim to support Python 3.12, or at least edit the official docs to report that it doesn't yet support Python 3.12 (https://mmdetection.readthedocs.io/en/latest/get_started.html#prerequisites)

vittorio-prodomo avatar Mar 07 '25 17:03 vittorio-prodomo

here is a workaround that at least makes mim work: pip install --upgrade setuptools but I'm not sure if there are any other bugs after this upgrading

WiiliamC avatar May 18 '25 08:05 WiiliamC