How add folders to 1 exe files #7822
-
my project
my packing command pyinstaller --onefile --add-data "./static/*;static" --add-data "./templates/*;templates" main.py result Traceback (most recent call last):
File "main.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
File "app.py", line 19, in <module>
File "starlette\staticfiles.py", line 57, in __init__
RuntimeError: Directory 'static' does not exist
[4600] Failed to execute script 'main' due to unhandled exception!` |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
|
Beta Was this translation helpful? Give feedback.
-
from fastapi import FastAPI, Request, UploadFile, File, Query
from fastapi.templating import Jinja2Templates
from fastapi.staticfiles import StaticFiles
from fastapi.responses import HTMLResponse |
Beta Was this translation helpful? Give feedback.
This works for me.