Code runs interactively but won't run from a file

Posted by lospinoj on 2019-09-02 15:25

I've successfully installed the ipwhois module. Sample code will run interactively, but the same code will not run from a file:

ImportError: cannot import name 'IPWhois'

The same case for 3.4 and 3.6.

I'm new to Python, retraining after 20 years of Perl. Any help would be greatly appreciated.

Jeff

grahams
ActiveState Staff
Thu, 2019-09-12 10:11

There's one whois post in our read-only Usage section, but it seems like you're hitting that issue before the posted problem could happen.
https://community.activestate.com/node/23248

IPWhois is a third-party module and is maintained by it's author. The source code is here:
https://github.com/secynic/ipwhois/

There is a reported issue that looks more like yours. You might discover that Windows 10 is a factor, and that the behaviour is different on Windows 7.