My Python version is 3.10.13, using a .venv environment. The spaCy model I load is zh_core_web_trf. The code runs normally in VSCode, but when I package it with PyInstaller, it shows an error. I have already packaged the model files and spaCy-related modules, and have also installed spacy-transform.
I have tried switching between Conda and venv environments, as well as including hidden imports in the .spec file, and changing the code from spacy.load(modelname) to modelname.load().