-
Notifications
You must be signed in to change notification settings - Fork 66
Internal server error after packaging with pyinstaller #9
Comments
Could you please give some more information? Operative System and the output of the console. Check first if it works with one directory mode and the one file and in case of error show us the console |
Hi, I just tried using one directory mode and it works! |
Internal server error is the one shown in the main window, can you show us the error in the console? The trace of the error. |
Sorry do you mind teaching me how do I check the console for the
executable?
…On Thu, 8 Mar 2018, 20:44 Ezequiel Leonardo Castaño, < ***@***.***> wrote:
Internal server error is the one shown in the main window, can you show us
the error in the console? The trace of the error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYZCVoAtQ3hWmbtn2si8q-CAx2zsno6oks5tcSewgaJpZM4ShLNV>
.
|
Just run pyinstaller without the |
Thanks! This is the traceback. I've added the templates folders using the
add data command.
[2018-03-09 01:52:37,889] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "site-packages\flask\app.py", line 1982, in wsgi_app
File "site-packages\flask\app.py", line 1614, in full_dispatch_request
File "site-packages\flask\app.py", line 1517, in handle_user_exception
File "site-packages\flask\_compat.py", line 33, in reraise
File "site-packages\flask\app.py", line 1612, in full_dispatch_request
File "site-packages\flask\app.py", line 1598, in dispatch_request
File "app.py", line 25, in index
File "site-packages\flask\templating.py", line 133, in render_template
File "site-packages\jinja2\environment.py", line 869, in
get_or_select_template
File "site-packages\jinja2\environment.py", line 830, in get_template
File "site-packages\jinja2\environment.py", line 804, in _load_template
File "site-packages\jinja2\loaders.py", line 113, in load
File "site-packages\flask\templating.py", line 57, in get_source
File "site-packages\flask\templating.py", line 85, in _get_source_fast
jinja2.exceptions.TemplateNotFound: index.html
127.0.0.1 - - [09/Mar/2018 01:52:37] "GET / HTTP/1.1" 500 -
…On Thu, Mar 8, 2018 at 10:01 PM, Ezequiel Leonardo Castaño < ***@***.***> wrote:
Just run pyinstaller without the w flag
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYZCVlMb7MawrDJ9F4gPkM2rPht4NMP3ks5tcTm9gaJpZM4ShLNV>
.
|
So either you don't use the --add-data param in the pyinstaller or you have a problem with your templates |
I used the --add-data param as instructed in the readme.md, and the app
works fine in one dir and when I run it from the terminal.
My app.spec:
# -*- mode: python -*-
block_cipher = None
a = Analysis(['app.py'],
pathex=['C:\\Program Files (x86)\\Windows
Kits\\10\\Redist\\ucrt\\DLLs\\x64',
'C:\\Users\\me\\Desktop\\pythonApp\\webdesk'],
binaries=[],
datas=[('templates', 'templates'), ('static', 'static')],
hiddenimports=['ctypes'],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='app',
debug=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False )
…On Fri, Mar 9, 2018 at 2:19 AM, Ezequiel Leonardo Castaño < ***@***.***> wrote:
So either you don't use the --add-data param in the pyinstaller or you
have a problem with your templates
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYZCVhBNOSxWGq28VfAPkpH1Ezw7dRu-ks5tcXYXgaJpZM4ShLNV>
.
|
take a look at this it might be helpfull |
Thanks. I tried it, but still no luck. I think it's because pyinstaller does not set the env variable as mentioned in this link: https://stackoverflow.com/questions/7674790/bundling-data-files-with-pyinstaller-onefile edit; Fixed it!! Include this at the top, under imports
Define this in a helper script:
credit to Jonathon Reinhart additional notes:
|
Thanks for the comments, I will close the issue since it's solved |
Readme updated |
btw this is the app I made with pyfladesk; https://github.com/captmomo/drowzee |
Hi,
The app works when I run it locally. However once I convert it to an exe using pyinstaller, I get an internal server error. Any ideas on how or where I can start troubleshooting this? First time using pyinstaller. THanks!
The text was updated successfully, but these errors were encountered: