I installed the Google Cloud SDK and want the code I write to pass pylint. Unfortunately, anytime I import something from Google. * I get an error message:
E: 10, 0: No name 'cloud' in module 'path/to/my/current/module.google' (no-name-in-module)
E: 10, 0: Unable to import 'google.cloud' (import-error)
Versions:
$: pylint --version
pylint 1.7.0,
astroid 1.5.0
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4]
If I put a hook in pylint to print the sys path, I get nothing interesting. Google-cloud-sdk is in /usr/local/lib/python2.7/dist-packagesso that it can find it.
['/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/pylint-1.7.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/backports.functools_lru_cache-1.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/configparser-3.5.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/singledispatch-3.4.0.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/editdistance-0.3.1-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/mccabe-0.6.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/astroid-1.5.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/wrapt-1.10.10-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/lazy_object_proxy-1.2.2-py2.7-linux-x86_64.egg', '/usr/lib/python2.7/dist-packages']
Does anyone know why it is looking for my local path for the google module and how can I fix it?
Updates with more details about my environment:
The Google Cloud SDKs under consideration are located at:
/usr/local/lib/python2.7/dist-packages/google
if I lsshow this directory:
api auth cloud gapic gax iam ...
and if I follow these paths, all the modules will be in the places where I expect them to be given import instructions.
__init__.py, , . , , : pylint ? , " ":
https://docs.pylint.org/en/latest/user_guide/run.html?highlight=re
mypy.