The requirements are missing oauth2client as a dependency. pip install tensor2tensor does not install it, nor it has been specified in setup.py.
OS: macOS 10.13
$ pip freeze | grep tensor
tensor2tensor==1.6.3
tensorboard==1.8.0
tensorflow==1.8.0
$ python -V
Python 3.6.5
# Steps to reproduce:
1. `pip install tensor2tensor`
2. `t2t-trainer ...` (on any problem)
# Error logs:
Traceback (most recent call last):
File "/Workspace/venv3/lib/python3.6/site-packages/tensor2tensor/bin/t2t_trainer.py", line 28, in <module>
from tensor2tensor.utils import cloud_mlengine
File "/Workspace/venv3/lib/python3.6/site-packages/tensor2tensor/utils/cloud_mlengine.py", line 24, in <module>
from oauth2client.client import GoogleCredentials
ModuleNotFoundError: No module named 'oauth2client'
$ pip install oauth2client
or add it to setup.py#L34
Few more details:
setup.py requires google-api-python-client, which depended on oauth2client in past.
However, oauth2client is now deprecated (substituted by google-auth) and google-api-python-client does not depend on it anymore (it requires google-auth, uritemplate, google-auth-httplib2, httplib2, six).
Thus, I think the code in tensor2tensor/utils/cloud_mlengine.py should be updated to use only the non-deprecated API from google-api-python-client.
I also ran into this error and would like to see a fix since it impacts uses of tensor2tensor that have no references to CMLE.
Perfect !
Current fix is to add oauth2client to the deps (will have a new release out shortly) but we should move away from it because it's deprecated.
Most helpful comment
I also ran into this error and would like to see a fix since it impacts uses of tensor2tensor that have no references to CMLE.