-
I'm trying to package one of my projects GameYamlSpiderAndGenerator, I created a py file in the upper directory for packaging import gameyamlspiderandgenerator.__main__ But apparently pyinstaller can't find this library
So I added the PYTHONPATH=./GameYamlSpiderAndGenerator/.venv/lib/python3.12/site-packages pyinstaller --onefile \
--name GameYamlSpider \
--add-data "gameyamlspiderandgenerator/plugin:gameyamlspiderandgenerator/plugin" \
--add-data "./GameYamlSpiderAndGenerator/.venv/lib/python3.12/site-packages/language_data/data:language_data/data" \
--hidden-import gameyamlspiderandgenerator.plugin.gcores \
--hidden-import gameyamlspiderandgenerator.plugin.itchio \
--hidden-import gameyamlspiderandgenerator.plugin.steam \
--hidden-import yamlgenerator_hook_search \
--hidden-import language_data \
--hidden-import ruamel.yaml.string \
--hidden-import yamlgenerator_hook_validate \
pkg.py |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Sounds more likely to be environment mixup rather than anything to do with PyInstaller and adding a venv's site-packages to
|
Beta Was this translation helpful? Give feedback.
-
Looks like So But I'll look into adding a hook so that this will be handled automatically and out-of-the-box (i.e., collect the submodules and force collection mode as pyz+py). |
Beta Was this translation helpful? Give feedback.
Looks like
ruamel/yaml/string/__plug_in__.py
needs to be collected as a data file as well, based on this plugin listing code fromruamel.yaml
.So
--add-data ./GameYamlSpiderAndGenerator/.venv/lib/python3.12/site-packages/ruamel/yaml/string/__plug_in__.py:ruamel/yaml/string
.But I'll look into adding a hook so that this will be handled automatically and out-of-the-box (i.e., collect the submodules and force collection mode as pyz+py).