You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm packaging a python script which imports spacy with pyinstaller https://github.com/pyinstaller/pyinstaller into an executable. I get the error in the title when running the executable.
Traceback (most recent call last):
File "nlp.py", line 1, in <module>
import spacy
File "/home/mh/spacy-pyinstaller/venv/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "spacy/__init__.py", line 10, in <module>
File "/home/mh/spacy-pyinstaller/venv/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "thinc/neural/__init__.py", line 4, in <module>
File "/home/mh/spacy-pyinstaller/venv/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "thinc/neural/_classes/model.py", line 11, in <module>
File "/home/mh/spacy-pyinstaller/venv/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 489, in exec_module
exec(bytecode, module.__dict__)
File "thinc/neural/train.py", line 7, in <module>
File "optimizers.pyx", line 14, in init thinc.neural.optimizers
File "ops.pyx", line 24, in init thinc.neural.ops
ImportError: cannot import name _custom_kernels
[16858] Failed to execute script nlp
I don't know if this issue should be in the pyinstaller project or the spacy project. So I'm opening issues in both.
@svlandeg you're welcome. All spacy needed is what is called a PyInstaller "hook", which tells PyInstaller how to package the library. I've written up one that's a bit of a hack, and posted that on SO. Hopefully it'll work without one soon; I've got a PR on the way that will massively decrease the need for hooks.
Overview
I'm packaging a python script which imports spacy with pyinstaller https://github.com/pyinstaller/pyinstaller into an executable. I get the error in the title when running the executable.
Environment
Reproduction steps
All necessary files for reproduction are available at https://github.com/michaelhochleitner/spacy-pyinstaller .
I'm packaging the following python script.
I use the following command to package the script.
Here is my .spec file:
When running
I get the following output
I don't know if this issue should be in the pyinstaller project or the spacy project. So I'm opening issues in both.
Related issues
pyinstaller/pyinstaller#4696
#2536
#3831
https://stackoverflow.com/questions/59645155/spacy-2-2-3-filenotfounderror-errno-2-no-such-file-or-directory-thinc-neur
The text was updated successfully, but these errors were encountered: