D4-project / BGP-Ranking

BGP ranking is a free software to calculate the security ranking of Internet Service Provider (ASN)
http://bgpranking.circl.lu/
GNU Affero General Public License v3.0
69 stars 6 forks source link

Import error - ModuleNotFoundError: No module named 'api' #14

Open SteveClement opened 3 years ago

SteveClement commented 3 years ago

Trying to import bgpranking results in error. See below.

(venv) misp@misp-test:~/code/mailoney$ pip install bgpranking-web
Collecting bgpranking-web
  Using cached bgpranking-web-1.2.tar.gz (2.1 kB)
Collecting requests
  Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.7-py2.py3-none-any.whl (138 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.2-py3-none-any.whl (59 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./venv/lib/python3.8/site-packages (from requests->bgpranking-web) (2.0.6)
Using legacy 'setup.py install' for bgpranking-web, since package 'wheel' is not installed.
Installing collected packages: urllib3, idna, certifi, requests, bgpranking-web
    Running setup.py install for bgpranking-web ... done
Successfully installed bgpranking-web-1.2 certifi-2021.10.8 idna-3.2 requests-2.26.0 urllib3-1.26.7
(venv) misp@misp-test:~/code/mailoney$ ipython
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.28.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import bgpranking_web
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-9ea4671a6f1e> in <module>
----> 1 import bgpranking_web

~/code/mailoney/venv/lib/python3.8/site-packages/bgpranking_web/__init__.py in <module>
----> 1 from api import *

ModuleNotFoundError: No module named 'api'
Rafiot commented 3 years ago

makes sense, this package is using the old version of bgpranking, this is the one you want to use: https://github.com/D4-project/BGP-Ranking/tree/master/client => from pybgpranking import BGPRanking (and yes, it is not on pypi, for reasons, I guess, no idea why)

I need to delete bgpranking-web from pypi. as it is definitely not working