4

I want to pack my application using pyoxidizer. I need to add PySide2 to my package.

policy.resources_location = "in-memory"
policy.resources_location_fallback =  "filesystem-relative:relative"
     
for resource in exe.pip_install(["pyside2"]):
    exe.add_python_resource(resource)

If I remove the line policy.resources_location_fallback = "filesystem-relative:relative", I get:

error[PYOXIDIZER_PYTHON_EXECUTABLE]: adding PythonExtensionModule<name=PySide2.Qt3DAnimation>

Caused by:
    extension module PySide2.Qt3DAnimation cannot be loaded from memory but memory loading required
   --> ./pyoxidizer.bzl:258:9
    |
258 |         exe.add_python_resource(resource)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ add_python_resource


error: adding PythonExtensionModule<name=PySide2.Qt3DAnimation>

Caused by:
    extension module PySide2.Qt3DAnimation cannot be loaded from memory but memory loading required

If the fallback is defined, I get the error:


Caused by:
    resource collector does not allow resources in filesystem-relative
   --> ./pyoxidizer.bzl:258:9
    |
258 |         exe.add_python_resource(resource)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ add_python_resource


error: adding PythonExtensionModule<name=PySide2.Qt3DAnimation>

Caused by:
    resource collector does not allow resources in filesystem-relative

This also applies for other packages like Pillow. I have not found anything to solve this issue and I'm not sure what this error message means.

System Information

  • Mac OS Big Sur, Ver. 11.5.1
  • Python 3.9.7
  • PySide2, ver 5.15.2
StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
agentsmith
  • 1,226
  • 1
  • 14
  • 27

1 Answers1

0

I fixed similar problem by using

exe.add_python_resources(exe.pip_install(["pyzmq"]))

But at the end of the day it didn't work anyway due to missing library, see indygreg/PyOxidizer/issues/339.

Zbyněk Winkler
  • 1,263
  • 1
  • 12
  • 12