Appveyor 上的 Kivy PyInstaller

Kivy PyInstaller on Appveyor

我想在 Appveyor 上使用 PyInstaller 为我的 Kivy 应用程序构建可执行文件。我的构建在我自己的计算机上运行,​​但在 Appveyor 构建上我收到以下消息:

OpenGL version detected: 1.1
Version: b'1.1.0'
Vendor: b'Microsoft Corporation'
Renderer: b'GDI Generic'
Try upgrading your graphics drivers and/or your graphics hardware in case of problems.
The application will leave now.

我正在使用 https://kivy.org/docs/guide/packaging-windows.html 中所述的默认 PyInstaller 配置。

appveyor.yml如下:

image: Visual Studio 2015

environment:
  matrix:
    - PYTHON: "C:\Python34"
      PYTHON_VERSION: "3.4.x" # currently 3.4.3
      PYTHON_ARCH: "32"

    - PYTHON: "C:\Python34-x64"
      PYTHON_VERSION: "3.4.x" # currently 3.4.3
      PYTHON_ARCH: "64"

install:
  # Install Python (from the official .msi of http://python.org) and pip when
  # not already installed.
  - ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 }

  - "SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%"

  # Check that we have the expected version and architecture for Python
  - "python --version"
  - "python -c \"import struct; print(struct.calcsize('P') * 8)\""

  - "pip install --disable-pip-version-check --user --upgrade pip"

  # Kivy and pyinstaller included
  - "%CMD_IN_ENV% pip install -r requirements.txt"

  # Saw somewhere on the internet, doesn't work with it nor without it.
  - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-desktop.ps1'))



build_script:
  - "%CMD_IN_ENV% python -m PyInstaller myapp.spec"


artifacts:
  - path: dist\*

据我所知,它可以有两种方式: * 以某种方式阻止 kivy pyinstaller hook 使用 OpenGL * 配置 Appveyor 使用 OpenGL

感谢您的所有建议!

恐怕这是不可能的,因为构建发生在没有物理 GPU 的 Hyper-V VM 中...

正如@ilyaf 所说,但有一件事可能对您有所帮助 - 尝试安装 kivy.deps.angle 并将其打包 + 制作您的应用程序 use the angle。我不太确定它是否有帮助,因为没有 GPU,但是 angle 将 OpenGL 调用转换为 DirectX,Appveyor 似乎有。值得一试,虽然我担心即使 angle.

也不行