SyntaxError: unexpected EOF while parsing (WHILE COMPILING)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SyntaxError: unexpected EOF while parsing (WHILE COMPILING)

AudeJavel12
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

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/435150e0-ce4d-442b-b41f-12da2c9cb332%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: SyntaxError: unexpected EOF while parsing (WHILE COMPILING)

bwoodsend
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

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/647aa5ee-d219-49d7-a13c-4bd0987d7811%40googlegroups.com.