Not able to use modules in Dash

Hi! I am getting these type of tracebacks while importing some modules.
shreyas@shreyas-HP-Notebook ~/App Using Dash> python3 poliastro.py Traceback (most recent call last): File "poliastro.py", line 5, in <module> import poliastro File "/home/shreyas/App Using Dash/poliastro.py", line 6, in <module> from poliastro.plotting import OrbitPlotter3D ModuleNotFoundError: No module named 'poliastro.plotting'; 'poliastro' is not a package

I am importing some modules like these.

from poliastro.plotting import OrbitPlotter3D from poliastro.bodies import Earth from poliastro.twobody.orbit import Orbit
Please help me out! How can I use OrbitPlotter3D that I am importing in the code!

It looks like you’ve named your file poliastro.py. This will shadow the actual poliastro package blocking its import and causing the error that you’ve gotten. Rename your file to something else and you should be good.

1 Like

Oh! is that it! Thanks!

1 Like