Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

object has no attribute 'query' #55

Closed
Finch4 opened this issue Aug 11, 2019 · 6 comments
Closed

object has no attribute 'query' #55

Finch4 opened this issue Aug 11, 2019 · 6 comments
Assignees

Comments

@Finch4
Copy link

Finch4 commented Aug 11, 2019

I already know that this problem has already been solved, but the solution for me was not that.
-my .py file name isn't whois.py
-whois version 0.8
-installed with pip3 install whois

Code:
target = ('google.com')
n = whois.query(target)
print(n)

@DannyCork
Copy link
Collaborator

thanks for raising the issue report.

I used the following code using python 3.6 :

import whois

target = ('google.com')
n = whois.query(target)
print(n.__dict__)

and got

$ p x.py 
{'name': 'google.com', 'registrar': 'MarkMonitor Inc.', 'creation_date': datetime.datetime(1997, 9, 15, 4, 0), 'expiration_date': datetime.datetime(2020, 9, 14, 4, 0), 'last_updated': None, 'name_servers': {'ns2.google.com', 'ns3.google.com', 'ns1.google.com', 'ns4.google.com'}}

What version of python are you using?

@DannyCork DannyCork self-assigned this Aug 20, 2019
@DannyCork DannyCork pinned this issue Aug 20, 2019
@DannyCork
Copy link
Collaborator

fixed in https://pypi.org/project/whois/0.9.2/

Please do a $ pip install --upgrade whois
and report back.
Thanks.

@Arinze1020
Copy link

Haven the same issue on -version 0.9.3
saying 'whois' has no attribute 'query'

@MariusMez
Copy link
Contributor

MariusMez commented Dec 14, 2019

Maybe you have an other python package with same import name. It's the case with the module python-whois which use the package name 'whois' too.

Try pip uninstall python-whois to check that

Try also to delete cache files : find . -name "*.pyc" -delete

@DannyCork DannyCork unpinned this issue Jan 9, 2020
@nicksamuel
Copy link

Can confirm uninstalling python-whois did the trick for me, seems there was a conflict. Thanks!

@IgorSonehara
Copy link

Had the same problem, for some reason the name of file can't be whois.py

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants