Arkueid / live2d-py

Live2D Library for Python (C++ Wrapper): Supports model loading, lip-sync and basic face rigging, precise click test.
https://arkueid.github.io/live2d-py-docs/
MIT License
55 stars 10 forks source link

是否支持MacOS系统? #22

Open HaishengLiang opened 4 days ago

HaishengLiang commented 4 days ago

通过pip安装的时候 cmake 编译报错 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/80/d572a4737626372915bca41c3afbfec9d173561a39a0a61bacbbfd1dafd4/numpy-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl (21.2 MB) Building wheels for collected packages: live2d-py Building wheel for live2d-py (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for live2d-py (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [152 lines of output] running bdist_wheel running build running build_py creating build/lib.macosx-13-x86_64-cpython-310/live2d copying package/live2d/init.py -> build/lib.macosx-13-x86_64-cpython-310/live2d creating build/lib.macosx-13-x86_64-cpython-310/live2d/utils copying package/live2d/utils/lipsync.py -> build/lib.macosx-13-x86_64-cpython-310/live2d/utils copying package/live2d/utils/log.py -> build/lib.macosx-13-x86_64-cpython-310/live2d/utils copying package/live2d/utils/init.py -> build/lib.macosx-13-x86_64-cpython-310/live2d/utils creating build/lib.macosx-13-x86_64-cpython-310/live2d/v3 copying package/live2d/v3/params.py -> build/lib.macosx-13-x86_64-cpython-310/live2d/v3 copying package/live2d/v3/init.py -> build/lib.macosx-13-x86_64-cpython-310/live2d/v3 running egg_info writing package/live2d_py.egg-info/PKG-INFO writing dependency_links to package/live2d_py.egg-info/dependency_links.txt writing requirements to package/live2d_py.egg-info/requires.txt writing top-level names to package/live2d_py.egg-info/top_level.txt reading manifest file 'package/live2d_py.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'package/live2d_py.egg-info/SOURCES.txt' copying package/live2d/v3/live2d.pyd -> build/lib.macosx-13-x86_64-cpython-310/live2d/v3 copying package/live2d/v3/live2d.pyi -> build/lib.macosx-13-x86_64-cpython-310/live2d/v3 running build_ext Python installation path: /usr/local/opt/python@3.10/bin Building extension for Python 3.10.15 (main, Sep 7 2024, 00:20:06) [Clang 15.0.0 (clang-1500.1.0.2.5)] Invoking CMake setup: 'cmake /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/build/lib.macosx-13-x86_64-cpython-310 -DPYTHON_EXECUTABLE=/Users/lixu/Downloads/live2d/venv/bin/python -DCMAKE_BUILD_TYPE=Release -DPYTHON_INSTALLATION_PATH=/usr/local/opt/python@3.10/bin' -- The C compiler identification is AppleClang 14.0.3.14030022 -- The CXX compiler identification is AppleClang 14.0.3.14030022 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done Release Found PYTHON_INSTALLATION_PATH in environment variables Runtime log: on -- Found Python: /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 (found version "3.12.4") found components: Development Development.Module Development.Embed Python_LIBRARIES /Library/Frameworks/Python.framework/Versions/3.12/lib/libpython3.12.dylib Host: x86 CMake Deprecation Warning at glew/build/cmake/CMakeLists.txt:7 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.

  -- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework
  -- Configuring done (1.9s)
  -- Generating done (0.2s)
  CMake Warning:
    Manually-specified variables were not used by the project:

      PYTHON_EXECUTABLE

  -- Build files have been written to: /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/build/temp.macosx-13-x86_64-cpython-310
  Invoking CMake build: 'cmake --build . --config Release -- -j2'
  [  3%] Building C object glew_s/CMakeFiles/glew_s.dir/__/__/src/glew.c.o
  [  3%] Building C object glew_s/CMakeFiles/glew.dir/__/__/src/glew.c.o
  [  5%] Linking C static library ../lib/libGLEW.a
  [  6%] Linking C shared library ../lib/libGLEW.dylib
  [  6%] Built target glew_s
  [  8%] Building CXX object Framework/CMakeFiles/Framework.dir/src/CubismCdiJson.cpp.o
  [  8%] Built target glew
  In file included from /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/Framework/src/CubismCdiJson.cpp:8:
  In file included from /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/Framework/src/CubismCdiJson.hpp:10:
  In file included from /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/Framework/src/CubismJsonHolder.hpp:10:
  /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/Framework/src/Utils/CubismJson.hpp:399:9: error: use of undeclared identifier '_snprintf_s'
          _snprintf_s(strbuf, 32, 32, "%f", this->_value);
          ^
  1 error generated.
  make[2]: *** [Framework/CMakeFiles/Framework.dir/src/CubismCdiJson.cpp.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  [ 10%] Building CXX object Framework/CMakeFiles/Framework.dir/src/CubismDefaultParameterId.cpp.o
  [ 12%] Building C object glew_s/CMakeFiles/glewinfo.dir/__/__/src/glewinfo.c.o
  make[1]: *** [Framework/CMakeFiles/Framework.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....
  /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/glew/src/glewinfo.c:18880:11: warning: 'CGLChoosePixelFormat' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
    error = CGLChoosePixelFormat(contextAttrs, &pf, &npix);
            ^
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:31:17: note: 'CGLChoosePixelFormat' has been explicitly marked deprecated here
  extern CGLError CGLChoosePixelFormat(const CGLPixelFormatAttribute *attribs, CGLPixelFormatObj OPENGL_NULLABLE * OPENGL_NONNULL pix, GLint *npix) OPENGL_DEPRECATED(10.0, 10.14);
                  ^
  /private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-install-l12jjxiw/live2d-py_434b209c909e42a5b90d72771af7863d/glew/src/glewinfo.c:18882:11: warning: 'CGLCreateContext' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
    error = CGLCreateContext(pf, NULL, &ctx);
            ^
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:48:17: note: 'CGLCreateContext' has been explicitly marked deprecated here
  extern CGLError CGLCreateContext(CGLPixelFormatObj pix, CGLContextObj OPENGL_NULLABLE share, CGLContextObj OPENGL_NULLABLE * OPENGL_NONNULL ctx) OPENGL_DEPRECATED(10.0, 10.14);
                  ^
  2 warnings generated.
  [ 13%] Linking C executable ../bin/glewinfo
  [ 13%] Built target glewinfo
  make: *** [all] Error 2
  Traceback (most recent call last):
    File "/Users/lixu/Downloads/live2d/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/lixu/Downloads/live2d/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/lixu/Downloads/live2d/venv/lib/python3.10/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 "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 438, in build_wheel
      return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 426, in _build
      return self._build_with_temp_dir(
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
      self.run_setup()
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 522, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
    File "<string>", line 104, in <module>
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 183, in setup
      return run_commands(dist)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
      dist.run_commands()
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
      self.run_command(cmd)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 995, in run_command
      super().run_command(command)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
      cmd_obj.run()
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 381, in run
      self.run_command("build")
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 995, in run_command
      super().run_command(command)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
      cmd_obj.run()
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 995, in run_command
      super().run_command(command)
    File "/private/var/folders/pt/hkk7t76n4b1fmnwbqsxq3kkc0000gn/T/pip-build-env-bmtjh3u6/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
      cmd_obj.run()
    File "<string>", line 53, in run
    File "<string>", line 101, in build_extension
    File "/usr/local/Cellar/python@3.10/3.10.15/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for live2d-py Failed to build live2d-py ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (live2d-py)

Arkueid commented 4 days ago

需要在 Cmake 清单中添加 Live2D Framework 和 Live2D Core 的宏定义和编译选项。(目前没有 MacOS 设备所以没写配置,可以参考 Cubism 官方的 Native Sample)