0

Command:

python3 main.py file.dump

I get an error stating that:

File "main.py", line 3, in

from .Histogram import Histogram

ImportError: attempted relative import with no known parent package

I do not know where i am going wrong. I am in the same directory where the dump file, the Histogram.py file and the main.py file are placed.

For the .py files click on the link below:

https://github.com/riscv-newop/riscv-newop/tree/master/rvnewop

I am clueless. Where am I going wrong?

Why is the Histogram file not getting imported ?

  • Does this answer your question? [Relative imports for the billionth time](https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time) – adamkwm Jul 13 '21 at 07:47

1 Answers1

0

since Histogram.py is in same folder as the main.py, You can simply write

from Histogram import Histogram 
obj = Histogram() 
Darshan V
  • 198
  • 9