PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

安装paddlenlp报错

Open yuwojiusi opened this issue 3 years ago • 10 comments

python 3.10.5 pip:22.1.2

已经安装paddle,通过pip安装paddleNLP一直报错,如下:

Collecting onnx<=1.9.0
  Using cached 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
  ╰─> [19 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/3y/l7wdm7416_x7xr154t2gj6300000gn/T/pip-build-env-ve3xyc2n/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/private/var/folders/3y/l7wdm7416_x7xr154t2gj6300000gn/T/pip-build-env-ve3xyc2n/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/3y/l7wdm7416_x7xr154t2gj6300000gn/T/pip-build-env-ve3xyc2n/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 281, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/private/var/folders/3y/l7wdm7416_x7xr154t2gj6300000gn/T/pip-build-env-ve3xyc2n/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 86, in <module>
          assert CMAKE, 'Could not find "cmake" executable!'
      AssertionError: Could not find "cmake" executable!
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

yuwojiusi avatar Jun 21 '22 08:06 yuwojiusi

看这个 log 似乎是在安装 paddle2onnxonnx 依赖的时候报错,看这个报错信息,AssertionError: Could not find "cmake" executable! 可以试试在当前环境下安装一个 cmake

FrostML avatar Jun 21 '22 11:06 FrostML

试下最新的代码,paddle2onnx在0.9.8版本后不再依赖onnx

jiangjiajun avatar Jun 23 '22 11:06 jiangjiajun

我也是遇到安装问题。 win10 python3.10.2 pip:22.1.2 在当前环境下也安装了cmake 但是还是出错。 Building wheels for collected packages: onnx Building wheel for onnx (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for onnx (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [98 lines of output] fatal: not a git repository (or any of the parent directories): .git C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\dist.py:772: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead warnings.warn( C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\config\setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead. warnings.warn(msg, warning_class) running bdist_wheel running build running build_py running create_version running cmake_build Using cmake args: ['C:\Program Files\CMake\bin\cmake.exe', '-DPYTHON_INCLUDE_DIR=C:\Python310\include', '-DPYTHON_EXECUTABLE=C:\Python310\python.exe', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cp310-win_amd64.pyd', '-DCMAKE_BUILD_TYPE=Release', '-DPY_VERSION=3.10', '-DONNX_USE_MSVC_STATIC_RUNTIME=ON', '-A', 'x64', '-T', 'host=x64', '-DONNX_ML=1', 'C:\Users\gjb\AppData\Local\Temp\pip-install-ynojtps_\onnx_b0e45b6432a5426489695a217b01ed73'] -- Building for: Visual Studio 16 2019 -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044. -- The C compiler identification is MSVC 19.29.30139.0 -- The CXX compiler identification is MSVC 19.29.30139.0 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: C:/Python310/python.exe (found suitable version "3.10.2", minimum required is "3.10") -- Found PythonLibs: C:/Python310/libs/python310.lib (found suitable version "3.10.2", minimum required is "3.10") Generated: C:/Users/gjb/AppData/Local/Temp/pip-install-ynojtps_/onnx_b0e45b6432a5426489695a217b01ed73/.setuptools-cmake-build/onnx/onnx-ml.proto CMake Error at CMakeLists.txt:292 (message): Protobuf compiler not found Call Stack (most recent call first): CMakeLists.txt:323 (relative_protobuf_generate_cpp)

  -- Configuring incomplete, errors occurred!
  See also "C:/Users/gjb/AppData/Local/Temp/pip-install-ynojtps_/onnx_b0e45b6432a5426489695a217b01ed73/.setuptools-cmake-build/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "C:\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
      main()
    File "C:\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 261, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\build_meta.py", line 244, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\build_meta.py", line 229, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\build_meta.py", line 281, in run_setup
      super(_BuildMetaLegacyBackend,
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 337, in <module>
      setuptools.setup(
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 177, in setup
      return run_commands(dist)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 193, in run_commands
      dist.run_commands()
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\dist.py", line 1229, in run_command
      super().run_command(command)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 299, in run
      self.run_command('build')
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 317, in run_command
      self.distribution.run_command(command)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\dist.py", line 1229, in run_command
      super().run_command(command)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\command\build.py", line 24, in run
      super().run()
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
      self.run_command(cmd_name)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 317, in run_command
      self.distribution.run_command(command)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\dist.py", line 1229, in run_command
      super().run_command(command)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "setup.py", line 233, in run
      self.run_command('cmake_build')
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 317, in run_command
      self.distribution.run_command(command)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\dist.py", line 1229, in run_command
      super().run_command(command)
    File "C:\Users\gjb\AppData\Local\Temp\pip-build-env-n_m735mg\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "setup.py", line 219, in run
      subprocess.check_call(cmake_args)
    File "C:\Python310\lib\subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:\\Program Files\\CMake\\bin\\cmake.exe', '-DPYTHON_INCLUDE_DIR=C:\\Python310\\include', '-DPYTHON_EXECUTABLE=C:\\Python310\\python.exe', '-DBUILD_ONNX_PYTHON=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DONNX_NAMESPACE=onnx', '-DPY_EXT_SUFFIX=.cp310-win_amd64.pyd', '-DCMAKE_BUILD_TYPE=Release', '-DPY_VERSION=3.10', '-DONNX_USE_MSVC_STATIC_RUNTIME=ON', '-A', 'x64', '-T', 'host=x64', '-DONNX_ML=1', 'C:\\Users\\gjb\\AppData\\Local\\Temp\\pip-install-ynojtps_\\onnx_b0e45b6432a5426489695a217b01ed73']' 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

ilovecode2018 avatar Jun 24 '22 04:06 ilovecode2018

@ilovecode2018

你好,看起来是在安装onnx的时候出了问题,请按照下面的顺序来安装paddlenlp

  1. 安装paddle2onnx pip install paddle2onnx==0.9.8
  2. 再安装paddlenlp

jiangjiajun avatar Jun 24 '22 06:06 jiangjiajun

@ilovecode2018

你好,看起来是在安装onnx的时候出了问题,请按照下面的顺序来安装paddlenlp

  1. 安装paddle2onnx pip install paddle2onnx==0.9.8
  2. 再安装paddlenlp

C:\Windows\system32>pip install paddle2onnx==0.9.8 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple ERROR: Could not find a version that satisfies the requirement paddle2onnx==0.9.8 (from versions: 0.3.1, 0.3.2, 0.4, 0.5, 0.5.1, 0.6, 0.7, 0.8, 0.8.1, 0.8.2, 0.9.0, 0.9.1, 0.9.2) ERROR: No matching distribution found for paddle2onnx==0.9.8 WARNING: There was an error checking the latest version of pip. 没有这个版本

ilovecode2018 avatar Jun 24 '22 12:06 ilovecode2018

你的系统是Windows 32位系统吗 @ilovecode2018

jiangjiajun avatar Jun 25 '22 04:06 jiangjiajun

你的系统是Windows 32位系统吗 @ilovecode2018

不是,是64位的。我现在解决了。解决方法是不能用python3.10。要用3.9可以正常安装

ilovecode2018 avatar Jun 28 '22 04:06 ilovecode2018

是的,onnx 只能在 python3.9 里运行,不然就没法安装

linonetwo avatar Sep 14 '22 08:09 linonetwo

是的,onnx 只能在 python3.9 里运行,不然就没法安装

paddle2onnx只能在 3.6<=python<=3.9 的版本安装 https://pypi.org/project/paddle2onnx/1.0.1/#files

image

huzing2524 avatar Oct 09 '22 08:10 huzing2524

是的,onnx 只能在 python3.9 里运行,不然就没法安装

paddle2onnx只能在 3.6<=python<=3.9 的版本安装 https://pypi.org/project/paddle2onnx/1.0.1/#files

image

我们会尽快发布3.10的版本哈

jiangjiajun avatar Oct 10 '22 06:10 jiangjiajun

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] avatar Dec 23 '22 00:12 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。

github-actions[bot] avatar Jan 06 '23 00:01 github-actions[bot]