Search code examples
pythonkivypyinstallerappveyor

Kivy PyInstaller on Appveyor


I would like to build the executables for my Kivy application using PyInstaller on Appveyor. I have the build working on my own computer, but on Appveyor build I get the following message:

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.

I am using the default PyInstaller configuration as described in https://kivy.org/docs/guide/packaging-windows.html.

The appveyor.yml is as follows:

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\*

As far as I see it, it can go two ways: * somehow prevent kivy pyinstaller hook from using OpenGL * configure Appveyor to use OpenGL

Thanks for all your suggestions!


Solution

  • As @ilyaf said, but one thing might help you - try to install kivy.deps.angle and package it with that + make your app use the angle. I'm not quite sure if it'll help as there's no GPU, but angle translates OpenGL calls to DirectX, which Appveyor seems to have. It's worth trying, though I'm afraid it'll be no-go even with angle.