indygreg/PyOxidizer

Unable to get psutil to work on MacOS (works on windows). Error: resource collector doesn't accept in-memory nor filesystem-relative.

fabioz opened this issue · 0 comments

With the following options (in Mac OS, M1, Ventura 13.4):

    for resource in exe.pip_install(
        [
            "psutil>=5",
        ]
    ):
        resource.add_location = "in-memory"
        resource.add_location_fallback = "filesystem-relative:lib"
        exe.add_python_resource(resource)

I'm getting the following error:

> pyoxidizer run
resolving 1 targets
resolving target install
resolving target exe
target Python distribution for aarch64-apple-darwin resolves to: https://github.com/indygreg/python-build-standalone/releases/download/20221220/cpython-3.10.9%2B20221220-aarch64-apple-darwin-pgo-full.tar.zst (sha256=5a4a1128f6aa53a2cf6f748d0632da938cca4656c21688fbc564755ec4cd3519)
reusing target Python distribution for host execution
installing modified distutils to /var/folders/s0/1n8754mn5j3_41kzvkg040wh0000gn/T/pyoxidizer-pip-installwKVoak/packages
modifying distutils/_msvccompiler.py for oxidation
modifying distutils/command/build_ext.py for oxidation
modifying distutils/unixccompiler.py for oxidation
pip installing to /var/folders/s0/1n8754mn5j3_41kzvkg040wh0000gn/T/pyoxidizer-pip-installwKVoak/install
Using pip 22.3.1 from /Users/fabioz/Library/Caches/pyoxidizer/python_distributions/python.5a4a1128f6aa/python/install/lib/python3.10/site-packages/pip (python 3.10)
Collecting psutil>=5
  Using cached psutil-5.9.7-cp38-abi3-macosx_11_0_arm64.whl (246 kB)
Installing collected packages: psutil
Successfully installed psutil-5.9.7
error[PYOXIDIZER_PYTHON_EXECUTABLE]: adding PythonExtensionModule<name=psutil._psutil_osx>
    
    Caused by:
        resource collector does not allow resources in filesystem-relative
       --> ./pyoxidizer.bzl:282:9
        |
    282 |         exe.add_python_resource(resource)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ add_python_resource
    
    
error: adding PythonExtensionModule<name=psutil._psutil_osx>

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

Is there anything I can do to work around this?