Delphix Products

Expand all | Collapse all

Python Module delphixpy 1.10.2.0 - Syntax error about def async(engine) druing import import delphix_engine

Jump to Best Answer
  • 1.  Python Module delphixpy 1.10.2.0 - Syntax error about def async(engine) druing import import delphix_engine

    Posted 02-26-2019 06:57:00 PM
    Hi, 
    I am tryng to use the Python Module. Installed the latest version delphixpy 1.10.2.0  . 
    However, not able to import the delphix_engin. 

    Here is the trace . 

    Traceback (most recent call last):
      File "vdb_provision_rest.py", line 6, in <module>
        from  delphixpy import delphix_engine
      File "/opt/lib/python3.7/site-packages/delphixpy/__init__.py", line 6, in <module>
        from . import web
      File "/opt/lib/python3.7/site-packages/delphixpy/web/__init__.py", line 22, in <module>
        from . import environment
      File "/opt/lib/python3.7/site-packages/delphixpy/web/environment/__init__.py", line 20, in <module>
        from delphixpy.web.environment.environment import *
      File "/opt/lib/python3.7/site-packages/delphixpy/web/environment/environment.py", line 22, in <module>
        from delphixpy.web.environment import user
      File "/opt/lib/python3.7/site-packages/delphixpy/web/environment/user/__init__.py", line 20, in <module>
        from delphixpy.web.environment.user.user import *
      File "/opt/lib/python3.7/site-packages/delphixpy/web/environment/user/user.py", line 26, in <module>
        from delphixpy import response_validator
      File "/opt/lib/python3.7/site-packages/delphixpy/response_validator.py", line 19, in <module>
        from delphixpy.job_context import wait
      File "/opt/lib/python3.7/site-packages/delphixpy/job_context.py", line 37
        def async(engine):
                ^
    SyntaxError: invalid syntax


    ............................................................................................................

    Code is 

    import sys
    import os
    import json
    import asyncio
    print (sys.path)
    from  delphixpy import delphix_engine







    #Virtualization


  • 2.  RE: Python Module delphixpy 1.10.2.0 - Syntax error about def async(engine) druing import import delphix_engine
    Best Answer

    Posted 02-26-2019 07:10:00 PM
    I believe we still only support python2.7, but your traceback shows 3.7


  • 3.  RE: Python Module delphixpy 1.10.2.0 - Syntax error about def async(engine) druing import import delphix_engine

    Posted 02-26-2019 08:38:00 PM
    Module Change log shows support for Python 2 &

    Changelog1.10.2
    • Python3 compatibility. Python2 and Python3 are both supported now. The Python2 wrappers will now require all strings be of type unicode and the Python3 wrappers will now require all strings to be of type str.




  • 4.  RE: Python Module delphixpy 1.10.2.0 - Syntax error about def async(engine) druing import import delphix_engine
    Best Answer

    Posted 02-27-2019 08:31:00 AM
    The error is because "async" is a reserved keyword in Python 3.7, try a previous release of python.