「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
それから私は自分のコードを書きました:
#! /usr/bin/python en
from shodan import WebAPI
SHODAN_API_KEY = "Key"
api = WebAPI(SHODAN_API_KEY)
# Wrap the request in a try/ except block to catch errors
それは私にエラーを与えました:
ImportError: cannot import name WebAPI
私は同様の問題を検索しました。いくつかの答えはファイル名の変更であり、いくつかはpycファイルの削除でした。両方の答えを試しましたが、うまくいきません。