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

ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects #2311

Open
dlaoy opened this issue Oct 24, 2023 · 10 comments
Assignees

Comments

@dlaoy
Copy link

dlaoy commented Oct 24, 2023

pip install paddlehub==2.1.0 下载失败,在此之前pip install paddlepaddle -U是下载成功了
系统:Windows 10 教育版
python版本:3.11.3
conda版本:23.5.2
部分错误代码: Traceback (most recent call last):
File "F:\anaconda\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "F:\anaconda\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\anaconda\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\build_meta.py", line 434, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\build_meta.py", line 419, in _build_with_temp_dir
self.run_setup()
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
super(BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
exec(code, locals())
File "", line 337, in
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_init
.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\core.py", line 201, in run_commands dist.run_commands()
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 969, in run_commands self.run_command(cmd)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 364, in run
self.run_command("build")
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\command\build.py", line 131, in run self.run_command(cmd_name)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "", line 233, in run
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-0oie5k26\overlay\Lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "", line 227, in run
File "F:\anaconda\Lib\subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['F:\anaconda\Library\bin\cmake.exe', '--build', '.', '--config', 'Release', '--', '/maxcpucount:4']' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for onnx
Failed to build onnx
ERROR: Could not build wheels for onnx, which is required to install pyproject.toml-based projects

@ahbon123
Copy link

I encounter the same errors, please help to solve this issue.

@willove
Copy link

willove commented Dec 27, 2023

change the Python version to 3.10

@sijunhe sijunhe assigned w5688414 and unassigned sijunhe Mar 4, 2024
@w5688414
Copy link

我尝试搜了一下,可能是python版本太高的原因,可以看看python3.8是否有问题。

onnx/onnx#5679
onnx/onnx#4376

@itmeicn
Copy link

itmeicn commented May 15, 2024

我用的python3.11.7也报此错误,如何解决呢?

@w5688414
Copy link

降低python版本,paddlehub已经停止更新了,欢迎开发者贡献

@itmeicn
Copy link

itmeicn commented May 15, 2024

Collecting onnx<=1.9.0 (from paddle2onnx>=0.5.1->paddlehub)
Using cached https://mirrors.163.com/pypi/packages/73/e9/5b953497c0e36df589fc60cc6c6b35a65eb67d9ad1e45a9163663e43426e/onnx-1.9.0.tar.gz (9.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "D:\python\pyside6Test.venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "D:\python\pyside6Test.venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\python\pyside6Test.venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zspym\AppData\Local\Temp\pip-build-env-j8qnf2o_\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
return self.get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zspym\AppData\Local\Temp\pip-build-env-j8qnf2o
\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in get_build_requires
self.run_setup()
File "C:\Users\zspym\AppData\Local\Temp\pip-build-env-j8qnf2o
\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\zspym\AppData\Local\Temp\pip-build-env-j8qnf2o_\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 86, in
AssertionError: Could not find "cmake" executable!
[end of output]

@itmeicn
Copy link

itmeicn commented May 15, 2024

python3.11.7 of win11x64 ,安装直接报错

@dlaoy
Copy link
Author

dlaoy commented May 15, 2024

python3.11.7 of win11x64 ,安装直接报错

降低版本吧,降到3.8试试

@itmeicn
Copy link

itmeicn commented May 16, 2024

python3.9.13 it's ok.

@yoyalin
Copy link

yoyalin commented May 29, 2024

3.8.8也可以

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants