Bashtheparty
Bashtheparty

Reputation: 21

ImportError: No module named dns.message

When I try to run sudo python dns2proxy.py in Ubuntu, I keep getting this error:

Traceback (most recent call last):
  File "dns2proxy.py", line 21, in <module>
    import dns.message
ImportError: No module named dns.message

I have the correct repository cloned (see here for GitHub link) and I'm in the correct directory. I've tried running it in Kali linux and it works flawlessly. My intention is to do a gnome-terminal -e "sudo python dns2proxy.py" and make the command run in another terminal.

Upvotes: 1

Views: 6869

Answers (1)

holdenweb
holdenweb

Reputation: 37003

Try running the command

pip install dnspython

or, if you are using your system Python (not recommended)

sudo pip install dnspython

This will install the dns package that is currently missing. If, as you say, you have cloned the repository and want to use that version (and possible edit it) you may instead use

[sudo] pip install -e .

from the cloned directory.

Upvotes: 2

Related Questions