0
import whois 
whois.whois('google.com') 

Error is :

Traceback (most recent call last):
 File "C:\Scripts\Email_Header\whois.py", line 1, in <module>     
  import whois   
 File "C:\Scripts\Email_Header\whois.py", line 2, in <module>     
  whois.whois('google.com') 
TypeError: 'module' object is not callable

I installed using pip install python-whois

Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253

1 Answers1

4

You've named your script whois.py which is masking the whois module you just downloaded. Python will import the whois script you've just wrote, call it and fail.

Name your file differently, for example scrpt.py and it works fine:

python scrpt.py
{
  "domain_name": [
    "GOOGLE.COM",
    "google.com"
  ],
  "org": "Google Inc.",
  "whois_server": "whois.markmonitor.com",
  "state": "CA",
Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253