Cognitive-Face-Python icon indicating copy to clipboard operation
Cognitive-Face-Python copied to clipboard

SyntaxError: Invalid Syntax On Windows 10 Py3

Open secbug opened this issue 6 years ago • 3 comments

Following the regular instructions in the read me on Win10 using Py3, it fails running "python sample" or "python3 sample"

$ python sample
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\runpy. py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37-32\lib\runpy. py", line 85, in _run_code                                                           
    exec(code, run_globals)
  File "sample\__main__.py", line 8, in
    from view import MyApp
  File "sample\view\__init__.py", line 15, in
    from view.panel_detection import DetectionPanel
  File "sample\view\panel_detection.py", line 90
    @util.async

SyntaxError: invalid syntax

secbug avatar Jan 29 '19 16:01 secbug

Hi @secbug , can you have a try with python x64?

acured avatar Jan 30 '19 03:01 acured

I actually did two things to fix this and start the app.

  1. Included the change in pull request #60 -
178 - def async(func):
178 +async def func()::
  1. Removed the offending line in panel_detection.py:
90 - @util.async

Are there negative side-effects to this, as I've seen none thus far in the UI.

secbug avatar Jan 30 '19 12:01 secbug

Right, Both of these are used to define the function as async. "@util.async" is just an easier way of saying async_detect = util.async(async_detect).

acured avatar Jan 31 '19 03:01 acured