PaddlePaddle / PaddleHub

Awesome pre-trained models toolkit based on PaddlePaddle. (400+ models including Image, Text, Audio, Video and Cross-Modal with Easy Inference & Serving)【安全加固,暂停交互,请耐心等待】
https://www.paddlepaddle.org.cn/hub
Apache License 2.0
12.74k stars 2.07k forks source link

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

Open dlaoy opened 1 year ago

dlaoy commented 1 year ago

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 commented 1 year ago

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

willove commented 11 months ago

change the Python version to 3.10

w5688414 commented 7 months ago

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

https://github.com/onnx/onnx/issues/5679 https://github.com/onnx/onnx/issues/4376

itmeicn commented 6 months ago

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

w5688414 commented 6 months ago

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

itmeicn commented 6 months ago

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(configsettings) ^^^^^^^^^^^^^^^^^^^^^ 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(configsettings, 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.runsetup() 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=setupscript) 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 commented 6 months ago

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

dlaoy commented 6 months ago

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

降低版本吧,降到3.8试试

itmeicn commented 6 months ago

python3.9.13 it's ok.

yoyalin commented 5 months ago

3.8.8也可以