You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also just upgraded from 0.19 to 0.20 with pip install --upgrade google-cloud and now can't import anything:
In [2]: from google.cloud import datastore
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-46f71c99c111> in <module>()
----> 1 from google.cloud import datastore
ImportError: cannot import name 'datastore'
I went in to site-packages and deleted every google package, then reinstalled google-cloud. Now I get this error:
In [1]: from google.cloud import datastore
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-46f71c99c111> in <module>()
----> 1 from google.cloud import datastore
/Users/jlowin/anaconda3/lib/python3.5/site-packages/google/cloud/datastore/__init__.py in <module>()
52
53
---> 54 from google.cloud.datastore.batch import Batch
55 from google.cloud.datastore.connection import Connection
56 from google.cloud.datastore.client import Client
/Users/jlowin/anaconda3/lib/python3.5/site-packages/google/cloud/datastore/batch.py in <module>()
22 """
23
---> 24 from google.cloud.datastore import helpers
25 from google.cloud.datastore._generated import datastore_pb2 as _datastore_pb2
26
/Users/jlowin/anaconda3/lib/python3.5/site-packages/google/cloud/datastore/helpers.py in <module>()
21 import itertools
22
---> 23 from google.protobuf import struct_pb2
24 from google.type import latlng_pb2
25 import six
ImportError: No module named 'google.protobuf'
Indeed, installing a fresh conda environment solved this. And I was able to solve it in the old environment by uninstalling all google packages and reinstalling -- protobuf was the holdout that I didn't think of at first. It wasn't enough to --upgrade google-cloud, I had to explicitly uninstall protobuf.
AFAICT it's out of our hands. The packages installed are identical after the upgrade but the directory structure is b0rked somehow by pip / setuptools.
UPDATE: I confirm your analysis about the clobbered google/cloud directory
@dhermes I'm suspicious that one or more of our dependencies (protobuf, gapic-*, grpc-*) as installed via google-cloud==0.19.0 b0rk the namespace-package bookkeeping, confusing pip on the upgrade
For what it's worth, after upgrading to 0.20, I run the following commands to get it working (doubtless some of the uninstalls are false positives but I haven't gone one by one to figure it out):
There appears to be an issue with the google-cloud upgrade itself, likely due to the modularization between 0.19.0 and 0.20.0. For some reason, packages like google-cloud-datastore 0.20.0 are not properly installed when doing an --upgrade (e.g. the venv/lib/python2.7/site-packages/google/cloud/datastore is missing).
Activity
tseaver commentedon Oct 4, 2016
As a baseline, installing into a fresh virtualenv works:
but an upgrade fails:
The culprit seems to be tied into upgrades to the
gapic-*packages:Which appear to have clobbered the
google.cloudnamespace package.tseaver commentedon Oct 4, 2016
@bjwatson Any thoughts?
jlowin commentedon Oct 4, 2016
Indeed, installing a fresh conda environment solved this. And I was able to solve it in the old environment by uninstalling all google packages and reinstalling -- protobuf was the holdout that I didn't think of at first. It wasn't enough to
--upgrade google-cloud, I had to explicitly uninstall protobuf.dhermes commentedon Oct 4, 2016
@tseaver See #2464 (comment) and #2464 (comment)
AFAICT it's out of our hands. The packages installed are identical after the upgrade but the directory structure is b0rked somehow by
pip/setuptools.UPDATE: I confirm your analysis about the clobbered
google/clouddirectorytseaver commentedon Oct 4, 2016
@dhermes I'm suspicious that one or more of our dependencies (
protobuf,gapic-*,grpc-*) as installed viagoogle-cloud==0.19.0b0rk the namespace-package bookkeeping, confusingpipon the upgradejlowin commentedon Oct 4, 2016
For what it's worth, after upgrading to 0.20, I run the following commands to get it working (doubtless some of the uninstalls are false positives but I haven't gone one by one to figure it out):
bjwatson commentedon Oct 4, 2016
@tseaver I followed @jlowin steps above, and don't see any issues with the GAPIC or gRPC packages after running
pip install google-cloud --upgrade.I tried these alternate instructions and had no problems:
There appears to be an issue with the
google-cloudupgrade itself, likely due to the modularization between0.19.0and0.20.0. For some reason, packages likegoogle-cloud-datastore 0.20.0are not properly installed when doing an--upgrade(e.g. thevenv/lib/python2.7/site-packages/google/cloud/datastoreis missing).Any ideas @jonparrott?
dhermes commentedon Jan 31, 2017
Closing this out as it seems to have gone stale
npetitclerc commentedon Feb 1, 2017
I had similar issues upgrading to 0.22.0 from 0.19.0 @jlowin solution worked for me:
@bjwatson FYI uninstalling google-cloud only didn't work for me.
dhermes commentedon Feb 1, 2017
Yes it seems
0.19.0is the problem, but it's unclear if anything can be done about it (other than having this issue here as a reference).chore: librarian release pull request: 20260316T210518Z (#2520)
feat: add bigquery.ml.get_insights function (#2493)