googleapis/python-ndb

Library depends on `six` but doesn't declare it

JelleZijlstra opened this issue · 1 comments

google.cloud.ndb has a runtime dependency on six (it's needed for import), but it's not declared as a dependency. Therefore, the library fails to import after installation into an empty environment.

% python3.11 -m venv ~/py/venvs/empty311
% source ~/py/venvs/empty311/bin/activate
(empty311) % pip install google-cloud-ndb
...
Successfully installed async-timeout-4.0.3 cachetools-5.3.1 certifi-2023.7.22 charset-normalizer-3.2.0 google-api-core-2.11.1 google-auth-2.23.0 google-cloud-core-2.3.3 google-cloud-datastore-2.18.0 google-cloud-ndb-2.2.0 googleapis-common-protos-1.60.0 grpcio-1.58.0 grpcio-status-1.58.0 idna-3.4 proto-plus-1.22.3 protobuf-4.24.3 pyasn1-0.5.0 pyasn1-modules-0.3.0 pymemcache-4.0.0 pytz-2023.3.post1 redis-4.6.0 requests-2.31.0 rsa-4.9 urllib3-1.26.16
(empty311) % python -c 'import google.cloud.ndb'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/jelle/py/venvs/empty311/lib/python3.11/site-packages/google/cloud/ndb/__init__.py", line 28, in <module>
    from google.cloud.ndb.client import Client
  File "/Users/jelle/py/venvs/empty311/lib/python3.11/site-packages/google/cloud/ndb/client.py", line 33, in <module>
    from google.cloud.ndb import context as context_module
  File "/Users/jelle/py/venvs/empty311/lib/python3.11/site-packages/google/cloud/ndb/context.py", line 23, in <module>
    import six
ModuleNotFoundError: No module named 'six'
(empty311) % python --version
Python 3.11.0

This is on macOS 13.4.1 but I don't think the OS matters.

It's really ridiculous!
Yesterday I deployed my website on google cloud and there was no problem.
But today, when I updated, my website went down, because of this error.
File "/layers/google.python.pip/pip/lib/python3.10/site-packages/google/cloud/ndb/context.py", line 23, in <module> import six ModuleNotFoundError: No module named 'six'
Because I was using the previous virtual environment, this error did not appear on my laptop.