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

shi*_*etz 1 whois python-2.7 pywhois

I tried to execute this code:

import whois
w = whois.whois('webscraping.com')
print w
Run Code Online (Sandbox Code Playgroud)

And I got the error above. Why?

小智 5

错误的库,解决方案是删除旧库并安装新库:

pip uninstall whois 
pip install python-whois
Run Code Online (Sandbox Code Playgroud)