Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

future = tasks.async(future, loop=self) SyntaxError: invalid syntax #6156

Closed
reber0 opened this issue Aug 24, 2021 · 2 comments
Closed

future = tasks.async(future, loop=self) SyntaxError: invalid syntax #6156

reber0 opened this issue Aug 24, 2021 · 2 comments
Labels
triage Please triage and relabel this issue

Comments

@reber0
Copy link

reber0 commented Aug 24, 2021

  • pyinstaller: 4.5.1
  • Version of Python: 3.9.1
  • Platform: macOS Catalina 10.15.7
  • How you installed Python: brew

the latest development version not work

step:
virtualenv -p python3 py3env
source py3env/bin/activate
cd /Users/xxx/py_code/mycode
pip3 install -r requirements.txt
pyinstaller --onefile main.py

102 INFO: PyInstaller: 5.0.dev0
102 INFO: Python: 3.9.1
116 INFO: Platform: macOS-10.15.7-x86_64-i386-64bit
117 INFO: wrote /Users/xxx/py_code/mycode/main.spec
120 INFO: UPX is not available.
121 INFO: Extending PYTHONPATH with paths
['/Users/xxx/py_code/mycode', '/Users/xxx/py_code/mycode']
456 INFO: checking Analysis
456 INFO: Building Analysis because Analysis-00.toc is non existent
456 INFO: Initializing module dependency graph...
460 INFO: Caching module graph hooks...
473 INFO: Analyzing base_library.zip ...
3765 INFO: Processing pre-find module path hook distutils from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
3767 INFO: distutils: retargeting to non-venv dir '/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9'
7039 INFO: Caching module dependency graph...
7207 INFO: running Analysis Analysis-00.toc
7214 INFO: Analyzing /Users/xxx/py_code/mycode/main.py
10345 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-urllib3.packages.six.moves.py'.
17717 INFO: Processing pre-safe import module hook six.moves from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-six.moves.py'.
23390 INFO: Processing module hooks...
23390 INFO: Loading module hook 'hook-cryptography.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23637 INFO: Loading module hook 'hook-jinja2.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23638 INFO: Loading module hook 'hook-psycopg2.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23639 WARNING: Hidden import "mx.DateTime" not found!
23639 INFO: Loading module hook 'hook-bcrypt.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23640 INFO: Loading module hook 'hook-certifi.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23644 INFO: Loading module hook 'hook-cx_Oracle.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23644 INFO: Loading module hook 'hook-passlib.py' from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
23795 INFO: Loading module hook 'hook-sqlite3.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
23874 INFO: Loading module hook 'hook-pkg_resources.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
24236 INFO: Processing pre-safe import module hook win32com from '/usr/local/lib/python3.9/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
24509 WARNING: Hidden import "pkg_resources.py2_warn" not found!
24509 WARNING: Hidden import "pkg_resources.markers" not found!
24514 INFO: Loading module hook 'hook-PyQt5.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
24780 WARNING: Hidden import "sip" not found!
24781 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
24781 INFO: Loading module hook 'hook-pytz.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
24946 INFO: Loading module hook 'hook-lib2to3.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
24976 INFO: Loading module hook 'hook-_tkinter.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
25136 INFO: checking Tree
25155 INFO: checking Tree
25245 INFO: checking Tree
25249 INFO: Loading module hook 'hook-encodings.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
25324 INFO: Loading module hook 'hook-distutils.util.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
25330 INFO: Loading module hook 'hook-zope.interface.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
25334 INFO: Loading module hook 'hook-gevent.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
25645 INFO: Determining a mapping of distributions to packages...
107805 WARNING: Unable to find package for requirement zope.event from package gevent.
107805 WARNING: Unable to find package for requirement zope.interface from package gevent.
107805 INFO: Packages required by gevent:
['greenlet', 'setuptools', 'setuptools']
108777 INFO: Processing pre-find module path hook site from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
108777 INFO: site: retargeting to fake-dir '/usr/local/lib/python3.9/site-packages/PyInstaller/fake-modules'
110648 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
110675 INFO: Loading module hook 'hook-pickle.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
110679 INFO: Loading module hook 'hook-heapq.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
110683 INFO: Loading module hook 'hook-difflib.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
110688 INFO: Loading module hook 'hook-sqlalchemy.py' from '/usr/local/lib/python3.9/site-packages/PyInstaller/hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/__init__.py", line 8, in <module>
    from . import util as _util
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/__init__.py", line 100, in <module>
    from .concurrency import asyncio
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/concurrency.py", line 12, in <module>
    from ._concurrency_py3k import await_only
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 1, in <module>
    import asyncio
  File "/usr/local/lib/python3.9/site-packages/asyncio/__init__.py", line 21, in <module>
    from .base_events import *
  File "/usr/local/lib/python3.9/site-packages/asyncio/base_events.py", line 296
    future = tasks.async(future, loop=self)
                   ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "/usr/local/bin/pyinstaller", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/__main__.py", line 124, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/__main__.py", line 58, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 775, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 707, in build
    exec(code, spec_namespace)
  File "/Users/xxx/py_code/mycode/main.spec", line 7, in <module>
    a = Analysis(
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 269, in __init__
    self.__postinit__()
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/building/datastruct.py", line 155, in __postinit__
    self.assemble()
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/building/build_main.py", line 437, in assemble
    self.graph.process_post_graph_hooks(self)
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/depend/analysis.py", line 326, in process_post_graph_hooks
    module_hook.post_graph(analysis)
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/depend/imphook.py", line 398, in post_graph
    self._load_hook_module()
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/depend/imphook.py", line 361, in _load_hook_module
    self._hook_module = importlib_load_source(self.hook_module_name, self.hook_filename)
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/compat.py", line 611, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 469, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 969, in load_module
  File "<frozen importlib._bootstrap_external>", line 794, in load_module
  File "<frozen importlib._bootstrap>", line 274, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/site-packages/PyInstaller/hooks/hook-sqlalchemy.py", line 31, in <module>
    dialects = eval(dialects.strip())
  File "<string>", line 0

SyntaxError: unexpected EOF while parsing
@reber0 reber0 added the triage Please triage and relabel this issue label Aug 24, 2021
@bwoodsend
Copy link
Member

step:
virtualenv -p python3 py3env
source py3env/bin/activate
cd /Users/xxx/py_code/mycode
pip3 install -r requirements.txt
pyinstaller --onefile main.py

This is no use to us as we don't have your code. You should write a self contained shareable example.

But I don't think you need to in this case. asyncio is standard lib and should not be in site-packages. You appear to have the obsolete backport installed which is being used instead of the real one. Try running pip uninstall asyncio then rerun pyinstaller.

@reber0
Copy link
Author

reber0 commented Aug 25, 2021

it's work, thanks.

@reber0 reber0 closed this as completed Aug 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage Please triage and relabel this issue
Projects
None yet
Development

No branches or pull requests

2 participants