googledatalab / pydatalab

Google Datalab Library
Apache License 2.0
194 stars 79 forks source link

Incompatibility with Python 3.7 #711

Closed sam3ay closed 4 years ago

sam3ay commented 6 years ago

Bug: Importing the datalab module fails in python 3.7

Steps to Reproduce:

[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from google import datalab

Expected: Successful import

Stack Trace:

  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/google/datalab/__init__.py", line 13, in <module>
    from google.datalab._context import Context
  File "/usr/local/lib/python3.7/site-packages/google/datalab/_context.py", line 20, in <module>
    from google.datalab.utils import _utils as du
  File "/usr/local/lib/python3.7/site-packages/google/datalab/utils/__init__.py", line 15
    from ._async import async, async_function, async_method
                            ^
SyntaxError: invalid syntax

Notes: Previous versions of python successfully imported datalab, so I'm assuming it's caused by async being a keyword in Python 3.7 hence the syntax error.

QuinRiva commented 6 years ago

I'm also getting this issue. So far by replacing references to async in __init__.py, _async.py and __lambdajob.py to asynchron I've managed to get it to import. I have yet to determine if this will cause any issues down the line.

olaoluthomas commented 5 years ago

@QuinRiva Could you provide more details? I've replaced all references to async in the modules you listed and I still get this error:

QuinRiva commented 5 years ago

@QuinRiva Could you provide more details? I've replaced all references to async in the modules you listed and I still get this error:

Sorry, it looks like the issues are somewhat more extensive. I would be good to determine if this is a live project, as currently many of the dependencies are wildly outdated - in thus incompatible with many of Google's other libraries.

slayerjain commented 5 years ago

I'm also facing the same problem. :(

HaipengSu commented 5 years ago

same problem here.

migachevalexey commented 5 years ago
same problem here.

from datalab import storage as storage File "/env/local/lib/python3.7/site-packages/datalab/storage/init.py", line 16, in from ._bucket import Bucket, Buckets File "/env/local/lib/python3.7/site-packages/datalab/storage/_bucket.py", line 21, in import datalab.context File "/env/local/lib/python3.7/site-packages/datalab/context/init.py", line 15, in from ._context import Context File "/env/local/lib/python3.7/site-packages/datalab/context/_context.py", line 20, in from . import _project File "/env/local/lib/python3.7/site-packages/datalab/context/_project.py", line 18, in import datalab.utils File "/env/local/lib/python3.7/site-packages/datalab/utils/init.py", line 15 from ._async import async, async_function, async_method ^ SyntaxError: invalid syntax

rezaprimasatya commented 5 years ago

I got error when using python3.7

from google import datalab from datalab.context import Context import google.datalab.storage as storage import google.datalab.bigquery as bq

any body still have same problem ?