Skip to content

PyQt6 .dll/.so load fails on Windows 10 and Ubuntu #508

@driftregion

Description

@driftregion

🐞 bug report

Affected Rule

I don't know. This is related to packaging the .dlls and .sos of python requirements. The most similar looking issue is: #381

Is this a regression?

I don't think so. I tested against 0.3.0 and 0.2.0

Description

Running the PyQt6 hello world example on Windows 10 fails due to being unable to find a PyQt .dll. It also fails on Ubuntu, unable to find .so files.

🔬 Minimal Reproduction

https://github.com/driftregion/rules_python_pyqt_bug_example

This issue doesn't affect all python packages which use dynamic libraries. I have confirmed that pygame works. I have confirmed it is actually using the .dlls packaged by rules_python by removing them at runtime but before import time and observing the same error thrown by PyQt when a .dll is unfindable.

https://github.com/driftregion/rules_python_pyqt_bug_example/tree/pygame

🔥 Exception or Error

Windows


$ bazel run ///main
INFO: Analyzed target //main:main (4 packages loaded, 1654 targets configured).
INFO: Found 1 target...
Target //main:main up-to-date: 
  bazel-bin/main/main.exe
  bazel-bin/main/main.zip
INFO: Elapsed time: 18.988s, Critical Path: 5.67s
INFO: 4 processes: 3 internal, 1 local.
INFO: Build completed successfully, 4 total actions
INFO: Build completed successfully, 4 total actions
Traceback (most recent call last):
  File "\\?\C:\Users\DELL\AppData\Local\Temp\Bazel.runfiles_xuoazixy\runfiles\poc\main\main.py", line 1, in 
    from PyQt6.QtWidgets import QApplication, QLabel
ImportError: DLL load failed while importing QtWidgets: The specified module could not be found.

Ubuntu


bazel run //main
INFO: Analyzed target //main:main (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //main:main up-to-date:
  bazel-bin/main/main
INFO: Elapsed time: 0.092s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Traceback (most recent call last):
  File "/home/user/.cache/bazel/_bazel_user/7fdfd63b75551a643294e497a1b5ea03/execroot/poc/bazel-out/k8-fastbuild/bin/main/main.runfiles/poc/main/main.py", line 1, in 
    from PyQt6.QtWidgets import QApplication, QLabel
ImportError: libQt6Widgets.so.6: cannot open shared object file: No such file or directory

🌍 Your Environment

Operating System:

  
Windows 10
  
  
Ubuntu 21.04
  

Output of bazel version:

Windows

  
Build label: 5.0.0-pre.20210623.2
Build target: bazel-out/x64_windows-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jul 2 14:21:47 2021 (1625235707)
Build timestamp: 1625235707
Build timestamp as int: 1625235707
  

Ubuntu

  
bazel version
Build label: 4.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 21 07:33:24 2021 (1611214404)
Build timestamp: 1611214404
Build timestamp as int: 1611214404
  

Rules_python version:

  
0.3.0
0.2.0
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions