我想用“shodan”API,但它不适合我。在
首先,我在终端easy_install shodan
中执行了这个命令
这是我的想法:
$easy_install shodan
Searching for shodan
Best match: shodan 0.8.1
Processing shodan-0.8.1-py2.7.egg
shodan 0.8.1 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/shodan-0.8.1-py2.7.egg
Processing dependencies for shodan
Finished processing dependencies for shodan
然后我写了我的代码:
^{pr2}$它给了我一个错误:
ImportError: cannot import name WebAPI
我搜索了类似的问题有些答案是更改文件名,有些是删除pyc文件。我试了两个答案,但也不管用。在
我找到了答案 我应该安装py crypto
sudo apt get安装python crypto
你的剧本叫什么名字?如果脚本的名称是“shodan”,即与shodan库同名,则可能会发生名称冲突。python3也有一个问题导致了一些导入问题,但是如果您使用的是shodanapi库的最新版本,那么应该解决这个问题。我附和luc的评论,即缩进看起来是错误的,所以您需要修复它,以便脚本执行。在
相关问题 更多 >
编程相关推荐