Poliastro: Cannot import module poliastro.earth

Created on 3 Jan 2021  路  2Comments  路  Source: poliastro/poliastro


I am trying to test the sample code provided by the docs for visualizing a ground-track of a satellite, but after installing poliastro and it's dependencies, I have trouble importing the module earth.

_Please let me know if some info is missing, I'll be happy to provide it._

馃悶 Problem

Sample Code

# Useful for defining quantities
from astropy import units as u

# Earth focused modules, ISS example orbit and time span generator
from poliastro.earth import EarthSatellite
from poliastro.earth.plotting import GroundtrackPlotter
from poliastro.examples import iss
from poliastro.util import time_range

# Build spacecraft instance
iss_spacecraft = EarthSatellite(iss, None)
t_span = time_range(iss.epoch - 1.5 * u.h, periods=150, end=iss.epoch + 1.5 * u.h)

# Generate an instance of the plotter, add title and show latlon grid
gp = GroundtrackPlotter()
gp.update_layout(title="International Space Station groundtrack")

# Plot previously defined EarthSatellite object
gp.plot(
    iss_spacecraft,
    t_span,
    label="ISS",
    color = "red",
    marker={"size": 10, "symbol": "triangle-right", "line": {"width": 1, "color": "black"}},
)

Traceback

Traceback (most recent call last):
  File "gt.py", line 5, in <module>
    from poliastro.earth import EarthSatellite
ModuleNotFoundError: No module named 'poliastro.earth'

pip freeze data

astropy==4.1
astroquery==0.4.1
beautifulsoup4==4.9.3
cached-property==1.5.2
certifi==2020.12.5
cffi==1.14.4
chardet==4.0.0
cryptography==3.3.1
cycler==0.10.0
html5lib==1.1
idna==2.10
importlib-metadata==3.3.0
jeepney==0.6.0
jplephem==2.15
keyring==21.8.0
kiwisolver==1.3.1
llvmlite==0.35.0
matplotlib==3.3.3
numba==0.52.0
numpy==1.19.4
pandas==1.1.5
Pillow==8.1.0
pkg-resources==0.0.0
plotly==4.14.1
poliastro==0.14.0
pycparser==2.20
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2020.5
requests==2.25.1
retrying==1.3.3
scipy==1.5.4
SecretStorage==3.3.0
six==1.15.0
soupsieve==2.1
typing-extensions==3.7.4.3
urllib3==1.26.2
webencodings==0.5.1
zipp==3.4.0

馃挕 Possible solutions

N/A

馃搵 Steps to solve the problem

N/A

support

Most helpful comment

Hi @lubeskih,

I see you are using poliastro==0.14.0 which does not include the poliastro.earth module. You were probably reading the latest documentation, which is built on top of the 0.15.dev0.

If you want to make use of previous sub-package and its utilities, you will need to install poliastro in "dev mode". A detailed description of the installation process can be found here.

Please, let us know if you find any kind of problem when following previous installation steps.

All 2 comments

Hi @lubeskih,

I see you are using poliastro==0.14.0 which does not include the poliastro.earth module. You were probably reading the latest documentation, which is built on top of the 0.15.dev0.

If you want to make use of previous sub-package and its utilities, you will need to install poliastro in "dev mode". A detailed description of the installation process can be found here.

Please, let us know if you find any kind of problem when following previous installation steps.

@jorgepiloto, thank you very much! That did the trick for me. Closing this issue. :)

Was this page helpful?
0 / 5 - 0 ratings