-
Notifications
You must be signed in to change notification settings - Fork 65
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
Python 3.12 uses mim prompt module 'pkgutil' has no attribute 'ImpImporter‘ #242
Comments
Looking forward to a reply! |
Hi, you can try to upgrade your pip with the following command. pip install -U pip |
Thank you very much for your reply. I have tried this method and it did not solve the problem, so I speculate that the problem is caused by the Python version |
"Due to the removal of the long-deprecated pkgutil.ImpImporter class, the pip command may not work for Python 3.12. You just have to manually install pip for Python 3.12" with: python -m ensurepip --upgrade
python -m pip install --upgrade setuptools |
Hi @yzezeze , did you find a working solution to your problem? I have been facing the same issue. openmim works fine with my py3.10 at local, but for training on the server I need py3.12 (because of some distributed-data-parallel reqs) which is incompatible with openmim. Please comment if you found a solution. |
Running into this in a new virtualenv with Python 3.12. Looks like pip install mim reverts setuptools to an old version which causes the issue. This is because openxlab has a ~= version requirement instead of a >= version. $ python -m pip install --upgrade setuptools
Requirement already satisfied: setuptools in /home/ruckc/.cache/pypoetry/virtualenvs/triton-mmdetection-MNiodkYm-py3.12/lib/python3.12/site-packages (60.2.0)
Collecting setuptools
Downloading setuptools-72.1.0-py3-none-any.whl.metadata (6.6 kB)
Downloading setuptools-72.1.0-py3-none-any.whl (2.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 46.1 MB/s eta 0:00:00
Installing collected packages: setuptools
Attempting uninstall: setuptools
Found existing installation: setuptools 60.2.0
Uninstalling setuptools-60.2.0:
Successfully uninstalled setuptools-60.2.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
openxlab 0.1.1 requires setuptools~=60.2.0, but you have setuptools 72.1.0 which is incompatible.
Successfully installed setuptools-72.1.0 |
I still have the same error working in a virtualenv with Python 3.8. Any updates on how to resolve the issue? |
chengwei@AIHUB: pip 24.0 |
I am not able to reproduce this issue on Python 3.12. However, a colleague has this issue. Has anyone had this issue then fixed it? What change needed to be done? I'm running Python 3.12.7 & pip 24.3.1. |
I'm using a conda environment. For me |
When using mim to install mmcv, an error message appears indicating that ImpImporter cannot be found. This attribute was removed in Python 3.12, which is suspected to be causing mim to be unusable.
Normal after changing the environment to Python 3.10.
The specific error display is as follows:
Traceback (most recent call last):
File "/home/zzbot/miniconda3/envs/UAV-WSL/bin/mim", line 5, in
from mim.cli import cli
File "/home/zzbot/miniconda3/envs/UAV-WSL/lib/python3.12/site-packages/mim/init.py", line 10, in
import setuptools # noqa: F401
^^^^^^^^^^^^^^^^^
File "/home/zzbot/miniconda3/envs/UAV-WSL/lib/python3.12/site-packages/setuptools/init.py", line 16, in
import setuptools.version
File "/home/zzbot/miniconda3/envs/UAV-WSL/lib/python3.12/site-packages/setuptools/version.py", line 1, in
import pkg_resources
File "/home/zzbot/miniconda3/envs/UAV-WSL/lib/python3.12/site-packages/pkg_resources/init.py", line 2172, in
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
The text was updated successfully, but these errors were encountered: