nf1s/covid

ModuleNotFoundError: No module named 'covid.john_hopkins'

AvinashReddy3108 opened this issue · 4 comments

Environment: Manjaro Linux [x64]
Python version: 3.8.2 (on base system AND virtualenv)
Covid library version: 2.0.1 (from PyPI)
File/Script: https://github.com/kandnub/TG-UserBot/blob/master/userbot/plugins/covid.py

Here's the traceback of the error [on my virtualenv, Python 3.8.2]

[11:12:18 / ERROR] userbot.utils.pluginManager: Failed to import userbot.plugins.covid due to the error(s) below.
[11:12:18 / ERROR] userbot.utils.pluginManager: No module named 'covid.john_hopkins'
Traceback (most recent call last):
  File "/mnt/sda4/GitHub Repos/PaperplaneRemix/userbot/utils/pluginManager.py", line 250, in _import_module
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/mnt/sda4/GitHub Repos/PaperplaneRemix/userbot/plugins/covid.py", line 17, in <module>
    from covid import Covid
  File "/mnt/sda4/PPRPLNRMX/lib/python3.8/site-packages/covid/__init__.py", line 2, in <module>
    from .john_hopkins import Covid as JohnHopkinsCovid
ModuleNotFoundError: No module named 'covid.john_hopkins'

The same on my base system [Manjaro Linux (latest x64, KDE), Python 3.8.2]

[avinash@rustbucket-manjaro ~]$ python3 --version
Python 3.8.2

[avinash@rustbucket-manjaro ~]$ pip3 --version
pip 20.0.2 from /usr/lib/python3.8/site-packages/pip (python 3.8)

[avinash@rustbucket-manjaro ~]$ pip3 install --user covid
Processing ./.cache/pip/wheels/e3/67/27/ca2216ad133cb7d84eb2cc7a68fd322ae65531e071779ee798/covid-2.0.1-py3-none-any.whl
Requirement already satisfied: requests in /usr/lib/python3.8/site-packages (from covid) (2.23.0)
Collecting pydantic
  Using cached pydantic-1.4-cp38-cp38-manylinux2010_x86_64.whl (9.6 MB)
Requirement already satisfied: chardet>=3.0.2 in /usr/lib/python3.8/site-packages (from requests->covid) (3.0.4)
Requirement already satisfied: idna>=2.5 in /usr/lib/python3.8/site-packages (from requests->covid) (2.9)
Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.8/site-packages (from requests->covid) (1.25.8)
Installing collected packages: pydantic, covid
Successfully installed covid-2.0.1 pydantic-1.4

[avinash@rustbucket-manjaro ~]$ python
Python 3.8.2 (default, Feb 26 2020, 22:21:03) 
[GCC 9.2.1 20200130] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import covid
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/avinash/.local/lib/python3.8/site-packages/covid/__init__.py", line 2, in <module>
    from .john_hopkins import Covid as JohnHopkinsCovid
ModuleNotFoundError: No module named 'covid.john_hopkins'
>>> 
nf1s commented

I have released the new version yesterday, although tests ran fine but perhaps I missed something. I will look into it.

nf1s commented

Thank you so much for reporting this issue, I managed to reproduce the error and currently working on a bugfix

nf1s commented

@AvinashReddy3108:
Please update your package to the latest version "2.0.4", that should have the correct fix. :)

@AvinashReddy3108:
Please update your package to the latest version "2.0.4", that should have the correct fix. :)

Alright, will test and let you know.
EDIT: it works, thanks for the fix.

Closing this issue.