indygreg / indygreg/PyOxidizer

pip-install-simple with PyQt5 fails on Windows

Open
#75 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

compatibility enhancement
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

My issue doesn't appear to be a duplicate of #74.

I've attempted to create a minimal example, described below. I'm running Miniconda on Windows.

First get pyoxidizer running with an initialized project:

conda create -n pyoxidizer rust
conda activate pyoxidizer
cargo install pyoxidizer
# add C:\Users\{user}\.cargo\bin to PATH and restart commdand prompt
pyoxidizer init pyapp
pyoxidizer build
pyoxidizer run  # this works fine

Next change pyoxidizer.toml to install PyQt5 using pip (this is just the bare bones config needed to reproduce the bug; I first encountered it when making minimal changes to the default config):

[[build]]
application_name = "pyapp"

[[packaging_rule]]
type = "stdlib-extensions-policy"
policy = "all"

[[packaging_rule]]
type = "stdlib"
include_source = false

[[packaging_rule]]
type = "pip-install-simple"
package = "pyqt5"

[[embedded_python_run]]
mode = "repl"




# END OF COMMON USER-ADJUSTED SETTINGS.
#
# Everything below this is typically managed by PyOxidizer and doesn't need
# to be updated by people.

[[python_distribution]]
build_target = "x86_64-apple-darwin"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-macos-20190618T0523.tar.zst"
sha256 = "6668202a3225892ce252eff4bb53a58ac058b6a413ab9d37c026a500c2a561ee"
[[python_distribution]]
build_target = "x86_64-pc-windows-msvc"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-windows-amd64-20190618T0516.tar.zst"
sha256 = "fd43554b5654a914846cf1c251d1ad366f46c7c4d20b7c44572251b533351221"
[[python_distribution]]
build_target = "x86_64-unknown-linux-gnu"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-linux64-20190618T0324.tar.zst"
sha256 = "d6b80a9723c124d6d193f8816fdb874ba6d56abfb35cbfcc2b27de53176d0620"
[[python_distribution]]
build_target = "x86_64-unknown-linux-musl"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-linux64-musl-20190618T0400.tar.zst"
sha256 = "2be2d109b82634b36685b89800887501b619ef946dda182e5a8ab5c7029a8136"


[[pyoxidizer]]
version = "0.2.0"
commit = ""

When I try to build again, I get this error:

processing packaging rule: PipInstallSimple(PackagingPipInstallSimple { package: "pyqt5", optimize_level: 0, excludes: [], include_source: true, install_location: Embedded, extra_args: None })
C:\Users\Jeffrey\Desktop\pyapp\build\target\x86_64-pc-windows-msvc\debug\pyoxidizer\python.fd43554b5654\python\install\python.exe: No module named ensurepip
installing modified distutils to C:\Users\Jeffrey\AppData\Local\Temp\pyoxidizer-pip-install.TloZDLxxmb3V\packages
modifying distutils/_msvccompiler.py for oxidation
modifying distutils/command/build_ext.py for oxidation
modifying distutils/unixccompiler.py for oxidation
pip installing to C:\Users\Jeffrey\AppData\Local\Temp\pyoxidizer-pip-install.TloZDLxxmb3V\install
Collecting pyqt5
  ERROR: Could not find a version that satisfies the requirement pyqt5 (from versions: none)
ERROR: No matching distribution found for pyqt5
thread 'main' panicked at 'error running pip', C:\Users\Jeffrey\.cargo\registry\src\github.com-1ecc6299db9ec823\pyoxidizer-0.2.0\src\pyrepackager\packaging_rule.rs:830:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

I guess that PyPI doesn't have a version of PyQt5 compatible with the particular Python distribution listed for Windows in the TOML file:

[[python_distribution]]
build_target = "x86_64-pc-windows-msvc"
url = "https://github.com/indygreg/python-build-standalone/releases/download/20190617/cpython-3.7.3-windows-amd64-20190618T0516.tar.zst"
sha256 = "fd43554b5654a914846cf1c251d1ad366f46c7c4d20b7c44572251b533351221"

I'm not sure why that would be, though, because there is currently a wheel available for Windows AMD 64 Python 3.7:

https://pypi.org/project/PyQt5/#files

PyQt5-5.12.3-5.12.4-cp35.cp36.cp37.cp38-none-win_amd64.whl

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows build using the provided pyoxidizer.toml and its pip-install-simple rule for pyqt5. Start at src/pyrepackager/packaging_rule.rs around the reported line 830 and inspect the pip installation path and platform handling. Done means the PyQt5 package can be processed successfully on the stated Windows target, or the failure is reported with a clear actionable cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.