indygreg / indygreg/PyOxidizer

PyOxidizer Hangs when Handling Text Encoding (SentenceTransformers)

Open
#728 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
6.2k
Forks
256
PR merge metrics
No merged PRs in 30d

Description

### Issue Summary
@indygreg
I am experiencing difficulties with PyOxidizer while generating an executable for my Python project. Specifically, the process seems to get stuck during text encoding, and ~I suspect it may be related to the loading of "__file__".~ _(I wrote a python script to verify every file in the sentence-transformers libraries, it doesn't contains __file__ string)_ Because all libraries like numpy, huggingface-cli work well in the bundle.

### Steps to Reproduce

- installed rustup and pyoxidizer
- Create a pyoxidizer project and add some Numpy, SentenceTransformers, other libraries
- make_exe content:
```python
def make_exe():
dist = default_python_distribution()

dependencies = ["-r", "requirements.txt"]

policy = dist.make_python_packaging_policy()
policy.resources_location_fallback = "filesystem-relative:lib"
python_config = dist.make_python_interpreter_config()
python_config.config_profile = "python"
python_config.run_module = "main"

exe = dist.to_python_executable(
name="oxid",
packaging_policy=policy,
config=python_config,
)

for resource in exe.pip_install(dependencies):
resource.add_location = "filesystem-relative:lib"
exe.add_python_resource(resource)

exe.add_python_resources(exe.read_package_root(
path="/path/to/the/app",
packages=["main", "app"],
))

return exe
```

### Expected Behavior

I want the app to encode the text using the sentenceTransformers lib, that I successfully loaded in the lib close to the exec.

### Actual Behavior

When it comes to encode the text, it stuck it do nothing. I detected that by ainserting a simple print before and after the line. And it never reach the after-print.

### Environment Information

- PyOxidizer version: 0.24.0
- Python version: 3.10
- Operating System: MacBook pro - OS X 14 and M2 chip

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided PyOxidizer make_exe configuration and the application’s SentenceTransformers text-encoding call, then reproduce the hang on Python 3.10 and macOS with the listed dependencies. Done means the bundled application completes encoding and reaches the print after that call; no specific source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.