How to declare folder dependencies
Hi,
I have this file system / folder system setup
main_folder/ ├─ src/ │ ├─ utils/ │ ├─ script.py │ ├─ script2.py │ ├─ script3.py ├─ main.py
What flag should be used in order to tell pyapp that the subfolder src is also needed when packaging? I am using the following setup to create the .exe
@echo off
set PYAPP_PROJECT_DEPENDENCY_FILE=G:\TheAnimeScripter\requirements-windows.txt
set PYAPP_EXEC_SCRIPT=G:\TheAnimeScripter\main.py
set PYAPP_PYTHON_VERSION=3.11
set PYAPP_PROJECT_NAME=tas
set PYAPP_PROJECT_VERSION=1.9.1
set PYAPP_EXPOSE_ALL_COMMANDS=true
set PYAPP_EXE_NAME=TheAnimeScripter
cargo build --release
And I get the following import errors
G:\pyapp-v0.22.0\target\release .\pyapp.exe
Traceback (most recent call last):
File "C:\Users\nilas\AppData\Local\pyapp\cache\scripts\327278503990150853\main.py", line 30, in <module>
from src.argumentsChecker import argumentChecker
ModuleNotFoundError: No module named 'src'
same as me
+1 not sure if people are only using this with 1-file scripts!
" You should turn your directory into a package and then you can embed that "
This is the response I got over discord, I would presume this implies adding __init__.py to all your directories so that pyapp can detect them as a typical package.
" You should turn your directory into a package and then you can embed that "
This is the response I got over discord, I would presume this implies adding
__init__.pyto all your directories so that pyapp can detect them as a typical package.
I am wondering whether you figured out a way. Thanks in advance.
" You should turn your directory into a package and then you can embed that " This is the response I got over discord, I would presume this implies adding
__init__.pyto all your directories so that pyapp can detect them as a typical package.I am wondering whether you figured out a way. Thanks in advance.
I honestly didn't due to Rust bitching about the compilation of pyapp, I just went down the route of using a portable python and pip installing the requirements during runtime. I like it more than relying on 3rd party libraries handling everything. As an added bonus, I should no longer worry about false positives from Windows Defender.
" You should turn your directory into a package and then you can embed that " This is the response I got over discord, I would presume this implies adding
__init__.pyto all your directories so that pyapp can detect them as a typical package.I am wondering whether you figured out a way. Thanks in advance.
I honestly didn't due to Rust bitching about the compilation of pyapp, I just went down the route of using a portable python and pip installing the requirements during runtime. I like it more than relying on 3rd party libraries handling everything. As an added bonus, I should no longer worry about false positives from Windows Defender.
Thank you!