【发布时间】:2023-03-26 17:33:01
【问题描述】:
我想在 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
感谢您的所有建议!
【问题讨论】:
-
实际上效果很好。我切换到
python35、Kivy 1.9.2-dev0和kivy.deps.angle。 OpenGL 2.0 被识别并且构建通过了。谢谢。 -
作为答案发表 ^^
标签: python kivy pyinstaller appveyor