0

I'm having issues when trying to import dns.resolver from dnspython. Whenever I import dns.resolver, I get an error (shown below). I've force reinstalled the module, restarted the computer, and I continue to get the same error. Thanks in advance.

import dns.resolver
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ModuleNotFoundError: No module named 'dns'

The version of python I'm using is 3.6.6

MarianD
  • 13,096
  • 12
  • 42
  • 54
Cynix22
  • 11
  • 3

1 Answers1

-1

There's an issue with installing via pip, but if you do you'll want to do this to import resolver (same goes for other classes):

from dns import resolver

Also, the examples you find online may change slightly.

This:

import dns.name
n = dns.name.from_text('www.dnspython.org')
o = dns.name.from_text('dnspython.org')

Becomes this:

from dns import name
n = name.from_text('www.dnspython.org')
o = name.from_text('dnspython.org')
DJSDev
  • 812
  • 9
  • 18