Arkueid / live2d-py

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

无法使用pip安装 #17

Open SunnyPai0413 opened 5 days ago

SunnyPai0413 commented 5 days ago

系统版本:GXDE bookworm 15.14.2 x86_64(就是debian12+dde15) 内核版本:Linux 6.10.11+bpo-amd64 Python版本:Python 3.11.2 PIP版本:pip 23.0.1 我尝试了使用文档中PyPi GitHub Setup.py三种安装方式,并依照报错安装了cmakewheel,依旧出现以下报错:

$ pip install live2d-py
Collecting live2d-py
  Using cached live2d_py-0.2.4.tar.gz (22.7 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages (from li
ve2d-py) (2.1.3)                                                                                                          Building wheels for collected packages: live2d-py
  Building wheel for live2d-py (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [99 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/live2d
      copying package/live2d/__init__.py -> build/lib.linux-x86_64-cpython-311/live2d
      creating build/lib.linux-x86_64-cpython-311/live2d/utils
      copying package/live2d/utils/__init__.py -> build/lib.linux-x86_64-cpython-311/live2d/utils
      copying package/live2d/utils/lipsync.py -> build/lib.linux-x86_64-cpython-311/live2d/utils
      copying package/live2d/utils/log.py -> build/lib.linux-x86_64-cpython-311/live2d/utils
      creating build/lib.linux-x86_64-cpython-311/live2d/v3
      copying package/live2d/v3/__init__.py -> build/lib.linux-x86_64-cpython-311/live2d/v3
      copying package/live2d/v3/params.py -> build/lib.linux-x86_64-cpython-311/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.linux-x86_64-cpython-311/live2d/v3
      copying package/live2d/v3/live2d.pyi -> build/lib.linux-x86_64-cpython-311/live2d/v3
      running build_ext
      Python installation path: /usr/bin
      Building extension for Python 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0]
      Invoking CMake setup: 'cmake /tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175 -DCMAKE_LIBRARY_OU
TPUT_DIRECTORY=/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/build/lib.linux-x86_64-cpython-311 -DPYTHON_EXECUTABLE=/home/sunnypai/Documents/Git/SP-Project/venv/bin/python3 -DCMAKE_BUILD_TYPE=Release -DPYTHON_INSTALLATION_PATH=/usr/bin'                                                                                                                 -- The C compiler identification is GNU 12.2.0
      -- The CXX compiler identification is GNU 12.2.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /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: /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: /usr/include/python3.11 (found version "3.11.2") found components: Development Development.Module D
evelopment.Embed                                                                                                                Python_LIBRARIES /usr/lib/x86_64-linux-gnu/libpython3.11.so
      CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
        Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
        OPENGL_INCLUDE_DIR)
      Call Stack (most recent call first):
        /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
        /usr/share/cmake-3.25/Modules/FindOpenGL.cmake:443 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
        glew/build/cmake/CMakeLists.txt:43 (find_package)

      -- Configuring incomplete, errors occurred!
      See also "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/build/temp.linux-x86_64-cpython-311/C
MakeFiles/CMakeOutput.log".                                                                                                     Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/setup.py", line 104, in <module>
          setup(
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/__init__.py", line 108,
 in setup                                                                                                                           return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", li
ne 185, in setup                                                                                                                    return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", li
ne 201, in run_commands                                                                                                             dist.run_commands()
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 969, in run_commands                                                                                                             self.run_command(cmd)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1213, in
 run_command                                                                                                                        super().run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 988, in run_command                                                                                                              cmd_obj.run()
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/wheel/_bdist_wheel.py", line 387, 
in run                                                                                                                              self.run_command("build")
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", lin
e 318, in run_command                                                                                                               self.distribution.run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1213, in
 run_command                                                                                                                        super().run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 988, in run_command                                                                                                              cmd_obj.run()
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/command/buil
d.py", line 132, in run                                                                                                             self.run_command(cmd_name)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", lin
e 318, in run_command                                                                                                               self.distribution.run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1213, in
 run_command                                                                                                                        super().run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 988, in run_command                                                                                                              cmd_obj.run()
        File "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/setup.py", line 53, in run
          self.build_extension(ext)
        File "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/setup.py", line 98, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2
175', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/build/lib.linux-x86_64-cpython-311', '-DPYTHON_EXECUTABLE=/home/sunnypai/Documents/Git/SP-Project/venv/bin/python3', '-DCMAKE_BUILD_TYPE=Release', '-DPYTHON_INSTALLATION_PATH=/usr/bin']' 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 live2d-py
  Running setup.py clean for live2d-py
Failed to build live2d-py
Installing collected packages: live2d-py
  Running setup.py install for live2d-py ... error
  error: subprocess-exited-with-error

  × Running setup.py install for live2d-py did not run successfully.
  │ exit code: 1
  ╰─> [104 lines of output]
      running install
      /home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/command/install.py:34: Setuptoo
lsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.                          warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/live2d
      copying package/live2d/__init__.py -> build/lib.linux-x86_64-cpython-311/live2d
      creating build/lib.linux-x86_64-cpython-311/live2d/utils
      copying package/live2d/utils/__init__.py -> build/lib.linux-x86_64-cpython-311/live2d/utils
      copying package/live2d/utils/lipsync.py -> build/lib.linux-x86_64-cpython-311/live2d/utils
      copying package/live2d/utils/log.py -> build/lib.linux-x86_64-cpython-311/live2d/utils
      creating build/lib.linux-x86_64-cpython-311/live2d/v3
      copying package/live2d/v3/__init__.py -> build/lib.linux-x86_64-cpython-311/live2d/v3
      copying package/live2d/v3/params.py -> build/lib.linux-x86_64-cpython-311/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.linux-x86_64-cpython-311/live2d/v3
      copying package/live2d/v3/live2d.pyi -> build/lib.linux-x86_64-cpython-311/live2d/v3
      running build_ext
      Python installation path: /usr/bin
      Building extension for Python 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0]
      Invoking CMake setup: 'cmake /tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175 -DCMAKE_LIBRARY_OU
TPUT_DIRECTORY=/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/build/lib.linux-x86_64-cpython-311 -DPYTHON_EXECUTABLE=/home/sunnypai/Documents/Git/SP-Project/venv/bin/python3 -DCMAKE_BUILD_TYPE=Release -DPYTHON_INSTALLATION_PATH=/usr/bin'                                                                                                                 -- The C compiler identification is GNU 12.2.0
      -- The CXX compiler identification is GNU 12.2.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /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: /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: /usr/include/python3.11 (found version "3.11.2") found components: Development Development.Module D
evelopment.Embed                                                                                                                Python_LIBRARIES /usr/lib/x86_64-linux-gnu/libpython3.11.so
      CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
        Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
        OPENGL_INCLUDE_DIR)
      Call Stack (most recent call first):
        /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
        /usr/share/cmake-3.25/Modules/FindOpenGL.cmake:443 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
        glew/build/cmake/CMakeLists.txt:43 (find_package)

      -- Configuring incomplete, errors occurred!
      See also "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/build/temp.linux-x86_64-cpython-311/C
MakeFiles/CMakeOutput.log".                                                                                                     Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/setup.py", line 104, in <module>
          setup(
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/__init__.py", line 108,
 in setup                                                                                                                           return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", li
ne 185, in setup                                                                                                                    return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", li
ne 201, in run_commands                                                                                                             dist.run_commands()
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 969, in run_commands                                                                                                             self.run_command(cmd)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1213, in
 run_command                                                                                                                        super().run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 988, in run_command                                                                                                              cmd_obj.run()
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/command/install.py", li
ne 68, in run                                                                                                                       return orig.install.run(self)
                 ^^^^^^^^^^^^^^^^^^^^^^
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/command/inst
all.py", line 698, in run                                                                                                           self.run_command('build')
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", lin
e 318, in run_command                                                                                                               self.distribution.run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1213, in
 run_command                                                                                                                        super().run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 988, in run_command                                                                                                              cmd_obj.run()
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/command/buil
d.py", line 132, in run                                                                                                             self.run_command(cmd_name)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", lin
e 318, in run_command                                                                                                               self.distribution.run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1213, in
 run_command                                                                                                                        super().run_command(command)
        File "/home/sunnypai/Documents/Git/SP-Project/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", li
ne 988, in run_command                                                                                                              cmd_obj.run()
        File "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/setup.py", line 53, in run
          self.build_extension(ext)
        File "/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/setup.py", line 98, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2
175', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-n0bea8pn/live2d-py_7b65e86e7c144a419c96d2651f1d2175/build/lib.linux-x86_64-cpython-311', '-DPYTHON_EXECUTABLE=/home/sunnypai/Documents/Git/SP-Project/venv/bin/python3', '-DCMAKE_BUILD_TYPE=Release', '-DPYTHON_INSTALLATION_PATH=/usr/bin']' 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: legacy-install-failure

× Encountered error while trying to install package.
╰─> live2d-py

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Arkueid commented 5 days ago

问题可能在于:

CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
        Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
        OPENGL_INCLUDE_DIR)

找到一个类似的 issue,可能是缺少 opengl 相关依赖:

sudo apt-get install libglu1-mesa-dev
sudo apt-get libgl1-mesa-dev
sudo apt-get install mesa-common-dev