Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Incompatibility with Python 3.7 #711

Closed
sam3ay opened this issue Oct 24, 2018 · 7 comments · Fixed by #728
Closed

Incompatibility with Python 3.7 #711

sam3ay opened this issue Oct 24, 2018 · 7 comments · Fixed by #728

Comments

@sam3ay
Copy link

sam3ay commented Oct 24, 2018

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
Copy link

QuinRiva commented Oct 30, 2018

I'm also getting this issue. So far by replacing references to async in __init__.py, _async.py and _lambda_job.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
Copy link

@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
Copy link

@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
Copy link

slayerjain commented Jun 3, 2019

I'm also facing the same problem. :(

@HaipengSu
Copy link
Contributor

same problem here.

@migachevalexey
Copy link

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
Copy link

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 ?

mark-velez added a commit to all-of-us/curation that referenced this issue Dec 27, 2019
Using google-cloud-bigquery because datalab in python3.7 yields syntax
error (see googledatalab/pydatalab#711)
ksdkalluri added a commit to all-of-us/curation that referenced this issue Dec 27, 2019
* Fix jupytext notebook load error.
* Update jupytext version in all the notebooks
* Set notebook interpreter to python3.7
 * Update start.sh and README
 * Remove incompatible notebook deps functools32 and futures
* Replace google.datalab with google.cloud for bigquery in notebooks
* Using google-cloud-bigquery because datalab in python3.7 yields syntax
   error (see googledatalab/pydatalab#711)
[ci skip]
noahgengel pushed a commit to noahgengel/curation that referenced this issue Jan 8, 2020
* Fix jupytext notebook load error.
* Update jupytext version in all the notebooks
* Set notebook interpreter to python3.7
 * Update start.sh and README
 * Remove incompatible notebook deps functools32 and futures
* Replace google.datalab with google.cloud for bigquery in notebooks
* Using google-cloud-bigquery because datalab in python3.7 yields syntax
   error (see googledatalab/pydatalab#711)
[ci skip]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants