Checklist
- I have searched related issues but cannot get the expected help. ✅
- I have read the FAQ documentation but cannot get the expected help. ✅
- The bug has not been fixed in the latest version. ✅
Describe the bug
mim install mmpretrain prints the following warnings with pip>=24.1:
Ignoring mmcv: markers 'extra == "mim"' don't match your environment
Ignoring mmdet: markers 'extra == "mim"' don't match your environment
Ignoring mmengine: markers 'extra == "mim"' don't match your environment
Followed by failed import of mmcv when importing the package. Basically, mim is failing to install its dependencies
Reproduction
- What command or script did you run?
conda create -n mm python=3.8
conda deactivate
conda activate mm
pip install --upgrade pip
pip install openmim
pip install torch
mim install mmpretrain
python -c "import mmpretrain"
pip list
Output:
(mm) $ pip install --upgrade pip
Requirement already satisfied: pip in miniconda3/envs/mm/lib/python3.8/site-packages (24.0)
Collecting pip
Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 60.8 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 24.0
Uninstalling pip-24.0:
Successfully uninstalled pip-24.0
Successfully installed pip-24.1.2
(mm) $ pip install torch
Collecting torch
... omitted for space
(mm) $ mim install mmpretrain
Looking in links: https://download.openmmlab.com/mmcv/dist/cu121/torch2.3.0/index.html
Collecting mmpretrain
Using cached mmpretrain-1.2.0-py2.py3-none-any.whl.metadata (20 kB)
Ignoring mmcv: markers 'extra == "mim"' don't match your environment
Ignoring mmengine: markers 'extra == "mim"' don't match your environment
... continues installing other required packages (omitted for space)
(mm) $ pip list
Package Version
------------------------ -----------
aliyun-python-sdk-core 2.15.1
aliyun-python-sdk-kms 2.16.3
certifi 2024.7.4
cffi 1.16.0
charset-normalizer 3.3.2
click 8.1.7
colorama 0.4.6
contourpy 1.1.1
crcmod 1.7
cryptography 42.0.8
cycler 0.12.1
einops 0.8.0
filelock 3.14.0
fonttools 4.53.1
fsspec 2024.6.1
idna 3.7
importlib_metadata 8.0.0
importlib_resources 6.4.0
Jinja2 3.1.4
jmespath 0.10.0
kiwisolver 1.4.5
Markdown 3.6
markdown-it-py 3.0.0
MarkupSafe 2.1.5
mat4py 0.6.0
matplotlib 3.7.5
mdurl 0.1.2
mmpretrain 1.2.0
model-index 0.1.11
modelindex 0.0.2
mpmath 1.3.0
networkx 3.1
numpy 1.24.4
nvidia-cublas-cu12 12.1.3.1
nvidia-cuda-cupti-cu12 12.1.105
nvidia-cuda-nvrtc-cu12 12.1.105
nvidia-cuda-runtime-cu12 12.1.105
nvidia-cudnn-cu12 8.9.2.26
nvidia-cufft-cu12 11.0.2.54
nvidia-curand-cu12 10.3.2.106
nvidia-cusolver-cu12 11.4.5.107
nvidia-cusparse-cu12 12.1.0.106
nvidia-ml-py 12.535.133
nvidia-nccl-cu12 2.20.5
nvidia-nvjitlink-cu12 12.5.82
nvidia-nvtx-cu12 12.1.105
nvitop 1.3.2
opendatalab 0.0.10
openmim 0.3.9
openxlab 0.1.1
ordered-set 4.1.0
oss2 2.17.0
packaging 24.1
pandas 2.0.3
pillow 10.4.0
pip 24.1.2
psutil 5.9.7
pycparser 2.22
pycryptodome 3.20.0
Pygments 2.18.0
pyparsing 3.1.2
python-dateutil 2.9.0.post0
pytz 2023.4
PyYAML 6.0.1
requests 2.28.2
rich 13.4.2
setuptools 60.2.0
six 1.16.0
sympy 1.13.0
tabulate 0.9.0
torch 2.3.1
tqdm 4.65.2
triton 2.3.1
typing_extensions 4.12.2
tzdata 2024.1
urllib3 1.26.19
wheel 0.43.0
zipp 3.19.2
(mm) $ python -c "import mmpretrain"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "miniconda3/envs/mm/lib/python3.8/site-packages/mmpretrain/__init__.py", line 2, in <module>
import mmcv
ModuleNotFoundError: No module named 'mmcv'
- Did you make any modifications on the code or config? Did you understand what you have modified? No
- What dataset did you use? N/A
Environment
- Please run
python mmdet/utils/collect_env.py to collect necessary environment information and paste it here. N/A, see pip list above, python=3.8.12
- You may add addition that may be helpful for locating the problem, such as
- How you installed PyTorch [e.g., pip, conda, source]: yes, torch==2.3.1, CUDA Version: 12.2
- Other environment variables that may be related (such as
$PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)
Error traceback
If applicable, paste the error trackback here.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/alex/miniconda3/envs/mm/lib/python3.8/site-packages/mmpretrain/__init__.py", line 2, in <module>
import mmcv
ModuleNotFoundError: No module named 'mmcv'
Bug fix
Reverting to pip<=24.0 resolved this issue. I believe the problem is related to this part of openmim, where we hack the pip installer to accept mim extras. This was working in previous pip versions but no longer works
The earliest version of pip where the bug is observed is 24.1b1
@ice-tong seemed to address this issue with the patched_requires code but I'm afraid the fix is no longer working
Checklist
Describe the bug
mim install mmpretrainprints the following warnings with pip>=24.1:Followed by failed import of mmcv when importing the package. Basically, mim is failing to install its dependencies
Reproduction
conda create -n mm python=3.8 conda deactivate conda activate mm pip install --upgrade pip pip install openmim pip install torch mim install mmpretrain python -c "import mmpretrain" pip listOutput:
Environment
python mmdet/utils/collect_env.pyto collect necessary environment information and paste it here. N/A, see pip list above, python=3.8.12$PATH,$LD_LIBRARY_PATH,$PYTHONPATH, etc.)Error traceback
If applicable, paste the error trackback here.
Bug fix
Reverting to pip<=24.0 resolved this issue. I believe the problem is related to this part of openmim, where we hack the pip installer to accept mim extras. This was working in previous pip versions but no longer works
The earliest version of pip where the bug is observed is 24.1b1
@ice-tong seemed to address this issue with the
patched_requirescode but I'm afraid the fix is no longer working