AttributeError: 'module' object has no attribute 'whois'

shira stenmetz picture shira stenmetz · Dec 15, 2016 · Viewed 8.8k times · Source

I tried to execute this code:

import whois
w = whois.whois('webscraping.com')
print w

And I got the error above. Why?

Answer

Oleg S picture Oleg S · Jun 7, 2017

Wrong library, solution is to remove old one and install new :

pip uninstall whois 
pip install python-whois