Unable to import module octodns.provider.googlecloud.GoogleCloudProvider
See original GitHub issueIf I remove the googlecloud provider, and just use YamlProvider, and DnsMadeEasyProvider, it works as expected.
CentOS 7, virtualenv, python2.7, installed today via pip, first time using octodns.
config/test.yaml:
---
providers:
config:
class: octodns.provider.yaml.YamlProvider
directory: ./config
googlecloud:
class: octodns.provider.googlecloud.GoogleCloudProvider
project: project1
credentials_file: ~/.google_cloud_credentials_file.json
dnsmadeeasy:
class: octodns.provider.dnsmadeeasy.DnsMadeEasyProvider
api_key: xxx
secret_key: xxx
zones:
testzone.com.:
sources:
- dnsmadeeasy
targets:
- config
- googlecloud
(octodns) 04/05 06:34[mdp@admin1-GOOGLE octodns]$ octodns-sync --config-file config/test.yaml
2018-04-05T06:34:38 [140319841122112] INFO Manager __init__: config_file=config/test.yaml
2018-04-05T06:34:38 [140319841122112] INFO Manager __init__: max_workers=1
2018-04-05T06:34:38 [140319841122112] INFO Manager __init__: max_workers=False
2018-04-05T06:34:38 [140319841122112] ERROR Manager _get_{}_class: Unable to import module octodns.provider.googlecloud.GoogleCloudProvider
Traceback (most recent call last):
File "/home/mdp/octodns/lib/python2.7/site-packages/octodns/manager.py", line 154, in _get_named_class
module = import_module(module_name)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/mdp/octodns/lib/python2.7/site-packages/octodns/provider/googlecloud.py", line 14, in <module>
from google.cloud import dns
ImportError: No module named google.cloud
Traceback (most recent call last):
File "/home/mdp/octodns/bin/octodns-sync", line 11, in <module>
sys.exit(main())
File "/home/mdp/octodns/lib/python2.7/site-packages/octodns/cmds/sync.py", line 37, in main
manager = Manager(args.config_file)
File "/home/mdp/octodns/lib/python2.7/site-packages/octodns/manager.py", line 98, in __init__
_class = self._get_named_class('provider', _class)
File "/home/mdp/octodns/lib/python2.7/site-packages/octodns/manager.py", line 158, in _get_named_class
raise Exception('Unknown {} class: {}'.format(_type, _class))
Exception: Unknown provider class: octodns.provider.googlecloud.GoogleCloudProvider
(octodns) 04/05 06:34[mdp@admin1-GOOGLE octodns]$
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Unable to import module octodns.provider.googlecloud. ...
If I remove the googlecloud provider, and just use YamlProvider, and DnsMadeEasyProvider, it works as expected.
Read more >ImportError: No module named 'google' - python
I installed Anaconda 3.5 and tried to run z sample code. But I'm getting the import error. Please find the screen shot attached....
Read more >Migrate to Google Cloud DNS Using OctoDNS: Part 1
In this multi-part series, we will install, configure, test and run OctoDNS to transfer on-prem DNS zones/records to Google Cloud DNS.
Read more >No module named 'google.cloud' in Python
To solve the Python ModuleNotFoundError: No module named 'google.cloud' error, install the specific google cloud module that you are importing, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This resolved it for me: pip install google-cloud-dns
Thanks @ross and @yzguy – That was indeed it, and your logic regarding the-pile-o-modules makes sense. Maybe in the Supported Providers table, it would make sense to add a column, which at a minimum mentions providers that require additional libraries, vs those that don’t. For bonus points, providing a link to that providers setup instructions could be helpful.
For the next newb that strolls through here, this is the full list of steps for me to setup a public GCE CentOS7 image with octodns for DNSME & google cloud dns:
Thanks!