question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to import module octodns.provider.googlecloud.GoogleCloudProvider

See original GitHub issue

If 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:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ckotilcommented, Feb 11, 2020

This resolved it for me: pip install google-cloud-dns

0reactions
DP-Mcommented, Apr 5, 2018

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:

sudo yum -y install python-pip python-devel python-setuptools
sudo pip install --upgrade pip virtualenv
virtualenv env
cd env
source bin/activate
pip install --upgrade google-cloud
pip install --upgrade octodns
Follow README instructions. 

Thanks!

Read more comments on GitHub >

github_iconTop 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 >
octodns
OctoDNS : DNS as code - Tools for managing DNS across multiple providers.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found