It seem that there is a conflict between pyDNS and dnspython built-in package :
** / ! \ To run this solution for python3 please replace pyDNS by py3DNS**
Step 1 remove dnspython :
$ pip uninstall dnspython
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: dnspython 1.15.0
Uninstalling dnspython-1.15.0:
Would remove:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/*
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dnspython-1.15.0.dist-info/*
Would not remove (might be manually added):
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Base.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Base.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Class.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Class.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Lib.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Lib.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Opcode.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Opcode.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Status.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Status.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Type.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/Type.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/lazy.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/lazy.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/win32dns.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dns/win32dns.pyo
Proceed (y/n)? y
Successfully uninstalled dnspython-1.15.0
Step 2 remove pyDNS :
$ pip uninstall pydns
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: pydns 2.3.6
Uninstalling pydns-2.3.6:
Would remove:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Base.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Base.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Class.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Class.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Lib.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Lib.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Status.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Status.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Type.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/Type.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/lazy.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/lazy.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/win32dns.py
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/DNS/win32dns.pyo
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydns-2.3.6.dist-info/*
Proceed (y/n)? y
Successfully uninstalled pydns-2.3.6`
### Step 2 Install pyDNS again :
`$ pip install pydns
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing /Library/Caches/pip/wheels/54/c3/70/622b2f4958520225fab47eceb1e2659ac4d03ec6760ec26024/pydns-2.3.6-py2-none-any.whl
Installing collected packages: pydns
Successfully installed pydns-2.3.6
Step 3 Check the installed package with :
$ python -m DNS
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named DNS.__main__; 'DNS' is a package and cannot be directly executed
Enjoy