Skip to content

fix: spacy model download with pyinstaller #7

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

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

ClemDoum
Copy link
Contributor

Bug description

As specified here, pyinstaller doesn't support starting a subprocess which call the python interpreter, since there's no interpreter in the binary built by pysintaller.

spacy.download however does call python -m pip install .... to install models.

This PR implements a hack to bypass this limitation, it additionally provides a hook to correctly install spacy in the pyinstaller build.

Changes

Changed

  • download spacy models directly instead of call spacy.download

Added

  • added a spacy pyinstaller hook for a proper spacy install during pyinstaller build

@ClemDoum ClemDoum marked this pull request as ready for review November 28, 2024 11:45
@ClemDoum ClemDoum added the bug Something isn't working label Nov 28, 2024
@ClemDoum ClemDoum self-assigned this Nov 28, 2024
@ClemDoum ClemDoum force-pushed the fix/spacy-with-pyinstaller branch from 9822699 to 8f029be Compare November 28, 2024 11:46
@ClemDoum ClemDoum merged commit fe68128 into main Nov 28, 2024
2 checks passed
@ClemDoum ClemDoum deleted the fix/spacy-with-pyinstaller branch November 28, 2024 11:50
@ClemDoum ClemDoum restored the fix/spacy-with-pyinstaller branch November 28, 2024 18:52
@ClemDoum ClemDoum deleted the fix/spacy-with-pyinstaller branch November 28, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant