GeezerVison is showing github.com — Firestore Client Doesn't Work in Python 3.3 · Issue #4115 · googleapis/google-cloud-python
Firestore Client Doesn't Work in Python 3.3 #4115DescriptionFirestore library doesn't work on Python 3.3. Here's a sequence of steps to reproduce:
$ virtualenv sandbox
$ cd sandbox
$ source bin/activate
$ pip install google-cloud-firestore --upgrade
$ python --version
Python 3.3.0
$ python -c 'from google.cloud import firestore'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/google/home/hkj/Projects/firebase-admin-python/public/sandbox/lib/python3.3/site-packages/google/cloud/firestore.py", line 18, in <module>
from google.cloud.firestore_v1beta1 import __version__
File "/usr/local/google/home/hkj/Projects/firebase-admin-python/public/sandbox/lib/python3.3/site-packages/google/cloud/firestore_v1beta1/__init__.py", line 20, in <module>
from google.cloud.firestore_v1beta1 import types
ImportError: cannot import name types
The issue seems to be grpc-related. The dependency takes an unusually long time to install.
Here's a link to a Travis build of the Firebase Admin SDK which depends on Firestore. Note how things fail only in the Python 3.3 environment. Activitylukesneeringer commented on Oct 3, 2017 Officially, we only support Python 3.4 and up (and 2.7), in keeping with the policy if most other large open source projects. That said, we will take a look at this and fix it if it is straightforward. :-) Reacted by Hiranya Jayathilaka tseaver commented on Oct 4, 2017 This is most likely down to pip / setuptools bugs WRT namespace packages. @hiranya911, can you please try adding the following:
$ pip install --upgrade setuptools pip
Before installing google-cloud-firestore? hiranya911 commented on Oct 6, 2017 ContributorAuthor More actions @tseaver Same error as before. Nothing was updated when I tried to upgrade setuptools and pip. My versions are:
- pip 9.0.1
- setuptools 36.5.0
Given that this also occurs in a Travis CI environment, I doubt that it is due to outdated tools. dhermes commented on Oct 6, 2017
Given that this also occurs in a Travis CI environment, I doubt that it is due to outdated tools.
Travis CI is not notorious for having up-to-date environments, e.g. their latest Ubuntu image is the previous LTS from April 2014. lukesneeringer commented on Oct 12, 2017 Hi @hiranya911,
I looked into this, and the ImportError is actually coming from grpc, which is issuing import enum.
enum was added to the standard library in Python 3.4, but there is a backport on PyPI for previous versions (pip install enum34). If you install enum34 from pip when using Python 3.3, things might work.
What I mean by "things might work" -- doing so will get you past that particular ImportError. I do not guarantee everything will work past that, since we do not officially support or test on Python 3.3. (Your chances are decent that everything will work fine, though.) lukesneeringer commented on Oct 12, 2017 @hiranya911 I also filed grpc/grpc#12976 that will fix this on their side.
Again, no promises of Python 3.3 support, but this seems like sufficiently low hanging fruit. Reacted by Hiranya Jayathilaka
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|