-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] Could not build wheels for mmcv, which is required to install pyproject.toml-based projects #2938
Comments
Hi @rbli-john , could you try to install wheel first? |
@zhouzaida You mean |
yes |
i am also facing the same issue. tried installing wheel first but it was already installed so it did not help. |
I also have the same error |
This issue may be caused by that the version of pytorch you have is 2.1.0. We will release a pre-compiled mmcv package that supports pytorch 2.1.0 in about a week, until then you can try to solve the problem by lowering your pytorch version to 2.0 or by compiling mmcv from source. Help documentation for compiling mmcv from source: https://mmcv.readthedocs.io/en/latest/get_started/build.html |
Can you provide more information? Such as the command or script did you run and the error traceback? |
Sorry, I cannot reproduce the error. But you can check the version of gcc. |
I encountered this problem too. And I solved it by pip installation regardless of mim. You can refer to their official documentation: customize-installation |
You can try to install mmcv from source. https://mmcv.readthedocs.io/en/latest/get_started/build.html#build-mmcv |
I have install mmcv from source, and it does show success. However, when I import mmcv, it throws an error. |
Same issue here. |
This is a version incompatibility issue and you may need to replace your pytorch version |
This helped |
I have built successfully with CUDA 12.2 and PyTourch 2.1.0+cu121 https://mmcv.readthedocs.io/en/latest/get_started/build.html pip3 install -r requirements/optional.txt pip3 install -e . -v Validate the installation sys.platform: win32
TorchVision: 0.16.0+cu121 |
This work for meI attempted to reinstall wheel with |
I have the same problem. I'm trying to run mit/bevfusion, but when configuring the environment I use |
It's because we do not provide the pre-complied MMCV package with torch1.10.1 and CUDA 11.3. You can try |
Thank you for your reply. After waiting for a long time, it built successfully. |
He means lowering the Pytorch. The word made me confused at first glance 😅 |
Same issue with pytorch@1.12 and pytorch@1.13. I solved this problem several weeks ago, but now just forget what i did |
Thanks, that really helpful, its work finally. |
I have the same issue with insightface package, how can I solve it? check.warn(importable)
|
Hi @galaltche , what is your pytorch and cuda version? BTW, what is your command to install mmcv-full? |
torch==2.1.2 and Cuda 9.1 |
Hi, torch2.1.2 should not provide the pre-built packages for cuda 9.1 so we also do not support it. Could you use cuda11.8 or cuda12.1? |
Same prob here. I have tried to install MMYOLO twice and both got error when it comes to Solution: by the way, in my second try i have facing the problem when i use assert (mmcv_version >= digit_version(mmcv_minimum_version)
and mmcv_version <= digit_version(mmcv_maximum_version)), \
f'MMCV=={mmcv.__version__} is used but incompatible. ' \
f'Please install mmcv>={mmcv_minimum_version}, <{mmcv_maximum_version}.'
# add '=' after '<' here is my workout enviroment: |
Except all solution above, please check your gcc. I have resolved by fix gcc env~~ It is linked to my Xcode config, very strange (xcode-select -switch) |
I also met this issue, my torch is 2.2.0 then I lower it to 2.1.0, issue still exists. So the solution is to lower it to 2.0.0? |
Installation guide for cuda 12.1 + torch 2.1.x is here: |
Hi! @senjacob this link has helped me to build mmcv successfully that supports pytorch 2.1.x. Thanks! |
The same problem was solved by changing the pytorch version: |
Do not understand why can not BUILD MMCV FROM SOURCE, I used the Install with pip. |
I also had same error message as this issue title. Followed instructions on https://mmdetection.readthedocs.io/en/latest/get_started.html Fixed with
on the same link broke with Python 3.10.14 Downgrading torch to 2.0.0 worked.
|
You can go to this website, select your operating system and cuda version and torch version and the mmcv version you want to install, and install mmcv using the command generated by it. |
@lurongkang123 I tried using the selector at https://mmcv.readthedocs.io/en/latest/get_started/installation.html, even though it installs mmcv properly, mmdet is not installable with pytorch 2.3 |
Sorry, I am just a beginner, do not understand this part of the content, may not be able to provide you with any help, I wish you an early solution to the problem |
This works |
It really works! Thanks a lot! 🌹
|
Hi @chenscottus , |
Prerequisite
Environment
Please see open-mmlab/mmdetection#10873
Reproduces the problem - code sample
Please see open-mmlab/mmdetection#10873 for details.
Reproduces the problem - command or script
Please see open-mmlab/mmdetection#10873 for details.
Reproduces the problem - error message
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/private/var/folders/dv/wbjrnyb94pv5djk1y4dkb_bc0000gp/T/pip-install-dqtzkf49/mmcv_6a35770b2d544b4d877baaec1726bc41/setup.py", line 437, in
setup(
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/init.py", line 155, in setup
return distutils.core.setup(**attrs)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 325, in run
self.run_command("build")
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 848, in build_extensions
build_ext.build_extensions(self)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 528, in build_extension
objects = self.compiler.compile(sources,
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 663, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1578, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/Users/rongbin/anaconda3/envs/openmmlab/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1921, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mmcv
Running setup.py clean for mmcv
Failed to build mmcv
ERROR: Could not build wheels for mmcv, which is required to install pyproject.toml-based projects
Additional information
No response
The text was updated successfully, but these errors were encountered: