Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging issue with GRPC and google-cloud-bigquery + optional packages? #83

Closed
shollyman opened this issue Apr 23, 2020 · 2 comments · Fixed by #87
Closed

Packaging issue with GRPC and google-cloud-bigquery + optional packages? #83

shollyman opened this issue Apr 23, 2020 · 2 comments · Fixed by #87
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: process A process-related concern. May include testing, release, or the like.

Comments

@shollyman
Copy link
Contributor

We're apparently losing some needed dependencies when using the optional installs for google-cloud-bigquery

$ ~/.pyenv/versions/3.8.2/bin/virtualenv repro
$ source repro/bin/activate
$ pip freeze 

(no results)

$ pip install --upgrade google-cloud-bigquery[bqstorage,pandas]
$ pip freeze > before.txt
$ cat before.txt

cachetools==4.1.0
certifi==2020.4.5.1
chardet==3.0.4
google-api-core==1.17.0
google-auth==1.14.1
google-cloud-bigquery==1.24.0
google-cloud-bigquery-storage==0.8.0
google-cloud-core==1.3.0
google-resumable-media==0.5.0
googleapis-common-protos==1.51.0
idna==2.9
numpy==1.18.3
pandas==1.0.3
protobuf==3.11.3
pyarrow==0.17.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
python-dateutil==2.8.1
pytz==2019.3
requests==2.23.0
rsa==4.0
six==1.14.0
urllib3==1.25.9

$ python
>>> from google.cloud import bigquery_storage_v1beta1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/google/home/shollyman/python_envs/repro/lib/python3.8/site-packages/google/cloud/bigquery_storage_v1beta1/__init__.py", line 26, in <module>
    from google.cloud.bigquery_storage_v1beta1 import client
  File "/usr/local/google/home/shollyman/python_envs/repro/lib/python3.8/site-packages/google/cloud/bigquery_storage_v1beta1/client.py", line 24, in <module>
    import google.api_core.gapic_v1.method
  File "/usr/local/google/home/shollyman/python_envs/repro/lib/python3.8/site-packages/google/api_core/gapic_v1/__init__.py", line 16, in <module>
    from google.api_core.gapic_v1 import config
  File "/usr/local/google/home/shollyman/python_envs/repro/lib/python3.8/site-packages/google/api_core/gapic_v1/config.py", line 23, in <module>
    import grpc
ModuleNotFoundError: No module named 'grpc'
$ pip install google-cloud-bigquery-storage
$ pip freeze > after.txt
$ diff before.txt after.txt

grpcio==1.28.1

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Apr 23, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 24, 2020
@plamut
Copy link
Contributor

plamut commented Apr 28, 2020

@shollyman Does the same happen if installing google-cloud-bigquery[all]? Though grpc should still not be missing even when installing a subset of extras.

Let me see if I can reproduce this locally.

@plamut plamut added type: question Request for information or clarification. Not an issue. and removed triage me I really want to be triaged. labels Apr 28, 2020
@plamut plamut self-assigned this Apr 28, 2020
@plamut
Copy link
Contributor

plamut commented Apr 28, 2020

I can confirm this.

The reason seems to be that we already specify google-api-core as a dependency (with no extras). When bqstorage extra tries to install BigQuery storage, the latter also specifies google-api-core[grpc] as its depenency, but with the [grpc] extra.

That grpc extra does not get installed, however. It appears that pip skips it, because it detects that google-api-core is already installed, but forgets about the extra. Only a theory, though, because the following actually works:

$ pip install google-api-core
$ pip install google-api-core[grpc]   # <--- installs grpcio

Update:
It seems to be an issue with the pip's dependency resolver. See this comment for the TL; DR version, which is what happens with our google-api-core dependency.

@plamut plamut added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: process A process-related concern. May include testing, release, or the like. and removed type: question Request for information or clarification. Not an issue. labels Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants