SyntaxError: unexpected EOF while parsing (WHILE COMPILING)

37 views
Skip to first unread message

AudeJavel12

unread,
May 22, 2020, 2:36:31 AM5/22/20
to PyInstaller
Hi, I use windows 10, Python 3.8.2 and latest PyInstaller as well
I have several py files (PyQt5 small application with several windows) which I would like to compile into 1 exe file. I tried to use pyinstaller with the following command:
pyinstaller --onefile main.py 

but at some point I get this error message:


  File "d:\python\lib\site-packages\PyInstaller\compat.py", line 797, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 962, in load_module
  File "<frozen importlib._bootstrap_external>", line 787, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "d:\python\lib\site-packages\PyInstaller\hooks\hook-sqlalchemy.py", line 30, in <module>
    dialects = eval(dialects.strip())
  File "<string>", line 0

    ^
SyntaxError: unexpected EOF while parsing

I've looked everywhere in my files I didnt see where I could have done EOF error. also my code is working very nicely from PyCharm.
I'm wondering if this is really my code mistake or compiling mistake when using many py files?
Thanks a lot for help.

Yohan Trens

bwoodsend

unread,
May 22, 2020, 8:02:10 AM5/22/20
to PyInstaller
Hi,

Judging by the fact it's one of PyInstaller's hooks raising the error I think it's almost certainly not your problem.

Could you run the following lines and share the results:

import sqlalchemy.databases
print(sqlalchemy.databases.__all__)

from PyInstaller.utils.hooks import exec_statement

databases
= exec_statement("import sqlalchemy.databases; print(sqlalchemy.databases.__all__)")
print(repr(databases))

If you aren't actually using sqlalchemy then you can just exclude it with `--exlcude-module sqlachemy`.

Brénainn
Reply all
Reply to author
Forward
0 new messages