Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fabioz opened this issue Dec 22, 2023 · 0 comments

Comments

@fabioz
Copy link

fabioz commented Dec 22, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant