0

What's the problem? this is all of the code which is I want to run, but this error makes it unusable!

from covid import Covid

covid = Covid()
covid.get_data()
Alireza Atashnejad
  • 612
  • 1
  • 6
  • 22

2 Answers2

1

Assuming you're using this package, it seems to work fine.

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from covid import Covid
>>>
>>> covid = Covid()
>>> covid.get_data()
[...]

Have you tried updating? If so, have you tried using any other module?

Also, make sure you're not running a file structure like

project
| covid
| | your-file.py

if you're running from covid import Covid from your-file.py, it will fail, since it's trying to import from the covid directory your-file.py is in.

Nexy7574
  • 514
  • 1
  • 5
  • 10
0

Just change the file name which is covid.py, so after that everything is working correctly.

Alireza Atashnejad
  • 612
  • 1
  • 6
  • 22