Skip to main content
v2026.11,986 entries · CC-BY 4.0

poliastro: Install, Use and Migrate an Archived Orbit Library

poliastro is an archived Python astrodynamics library: how to install it, run the quickstart orbit example, read output and move to hapsira.

Written and maintained by CASRAI Editorial Board

Published

On this page

poliastro is an open-source Python library for astrodynamics and orbital mechanics, covering orbit propagation, orbital-element conversion, maneuvers and Lambert’s problem. Its owner archived the GitHub repository on 14 October 2023, so the last release is 0.17.0 (10 July 2022) and the project will not be developed further. It still installs and runs on Python 3.8 to 3.10, and a fork called hapsira carries the code forward.

This page covers what the library does, how to install it from the official instructions, a worked orbit calculation with the exact calls from the quickstart, how to read the output, common installation problems, and where to move if you need an actively maintained package. The data table below the body lists the worked-example values taken from the documentation.

What poliastro is used for in research

The documentation describes poliastro as a pure Python library for interactive astrodynamics and orbital mechanics, written to be easy to use and to visualise. In research it is used to define orbits around a body, propagate them forward in time, plan impulsive maneuvers, solve Lambert’s problem between two ephemeris positions, and plot the results. The quickstart exercises each of these on small, checkable examples: a textbook state vector from Curtis, Mars at the J2000 epoch, the International Space Station, a Hohmann transfer and an Earth-to-Mars Lambert transfer.

Because the library works with Astropy quantities, every distance, speed and angle carries its unit, which removes a common class of errors in trajectory scripts. The same property helps reproducibility: a notebook that states 7283 x 10293 km x 153.2 deg as an orbit description is unambiguous to a reader.

Archived status and what it means for reproducibility

The repository README states that poliastro is archived and will not be developed any further, and the repository is read-only. Three consequences matter for research work. First, no fixes will arrive for incompatibilities with newer Python or NumPy releases, so an environment has to be pinned. Second, the pages at docs.poliastro.space remain readable and the code remains MIT licensed, so existing analyses can still be re-run. Third, citation remains possible: the authors ask users to cite the release on Zenodo (Juan Luis Cano Rodriguez, Jorge Martinez et al., 2023, “poliastro: poliastro 0.17.0”, DOI 10.5281/zenodo.6817189). Record the version and the DOI in your methods section the same way you would for any other software dependency.

For orbital data inputs, poliastro pairs naturally with catalogues such as CelesTrak for satellite element sets and with astroquery for archive queries. For the physics behind the orbit objects, see the CASRAI guides on flight mechanics and J2 perturbation.

How to install or access poliastro

Install only from the official project sources. The installation page lists the requirements as Python 3.8 to 3.10 together with Astropy, NumPy, jplephem, matplotlib, numba, Plotly and SciPy. It recommends conda with the conda-forge channel, and notes that mamba is a faster drop-in replacement. The README gives both commands:

  1. Create and activate a fresh virtual environment (or conda environment) that uses Python 3.8, 3.9 or 3.10.
  2. With conda, run conda install poliastro --channel conda-forge.
  3. With pip, run python -m pip install poliastro.
  4. For Jupyter notebooks, the installation page documents the extra pip install poliastro[jupyter].

The installation page advises using virtual environments and never using sudo pip. The source code lives at github.com/poliastro/poliastro and the documentation at docs.poliastro.space; the latest documentation release is 0.17.0.

How to define, propagate and plot an orbit step by step

The steps below follow the official quickstart, which uses an orbit from Curtis, example 4.3, then the International Space Station example bundled with the package. Run them in a notebook inside the pinned environment.

  1. Import the units, bodies and orbit class: from astropy import units as u, from poliastro.bodies import Earth, Mars, Sun, from poliastro.twobody import Orbit.
  2. Define the state vector with units: r = [-6045, -3490, 2500] << u.km and v = [-3.457, 6.618, 2.533] << u.km / u.s.
  3. Create the orbit: orb = Orbit.from_vectors(Earth, r, v). The quickstart shows this prints as 7283 x 10293 km x 153.2 deg (GCRS) orbit around Earth at epoch J2000.000 (TT).
  4. Alternatively build an orbit from classical elements: Orbit.from_classical(Sun, a, ecc, inc, raan, argp, nu). The quickstart uses Mars at J2000 from JPL HORIZONS (a = 1.523679 AU, ecc = 0.093315, inc = 1.85 deg, raan = 49.562 deg, argp = 286.537 deg, nu = 23.33 deg).
  5. Plot it with orb.plot(), which draws the orbit in its perifocal frame using Plotly.
  6. Propagate: from poliastro.examples import iss, then iss_30m = iss.propagate(30 << u.min). The epoch advances by 30 minutes.
  7. Plan a transfer: Maneuver.hohmann(orb_i, 36000 << u.km) from a 700 km circular Earth orbit created with Orbit.circular(Earth, alt=700 << u.km), then orb_i.apply_maneuver(hoh).
  8. Plot several orbits together with OrbitPlotter2D, calling op.plot(orbit, label=...) for each.

Other capabilities shown in the quickstart

The same page demonstrates ephemerides (Ephem.from_body and Ephem.from_horizons), small-body orbits from the JPL Small-Body Database (Orbit.from_sbdb("Apophis")), perturbed propagation with CowellPropagator including a J2 perturbation, low-thrust changes of eccentricity and inclination, Maneuver.lambert for an Earth-to-Mars transfer, and export of orbits to a CZML document for visualisation.

Perturbations, maneuvers and Lambert transfers in the quickstart

The perturbation example propagates an orbit with CowellPropagator, passing a user-written acceleration function. The first version adds a constant 1e-5 acceleration aligned with the velocity and propagates for three days, giving an orbit of 18255 x 21848 km x 28.0 deg. The second adds the J2 perturbation from poliastro.core.perturbations using Earth’s J2 and radius, propagates for 48 hours, and compares the final and initial orbits: the right ascension of the ascending node drifts at about -0.172 deg per hour and the argument of perigee at about 0.282 deg per hour. That is a quick way to check a J2 implementation against a hand calculation.

The low-thrust example changes eccentricity and inclination together from a geostationary-radius orbit (a = 42164 km, ecc 0.4 to 0, inclination 0 to 20 deg) with an acceleration of 2.4e-7 km/s^2, using the change_ecc_inc function to produce the control law. The Lambert example takes the launch date 2011-11-26 15:02 and the arrival date 2012-08-06 05:17 (TDB), builds the Earth and Mars orbits from ephemerides, and calls Maneuver.lambert to obtain the two impulses. A Lambert solution depends on the central body and the time of flight; the quickstart treats the transfer as a sequence of velocity impulses, one at departure and one at arrival.

How to read the output

An orbit prints as its periapsis and apoapsis radii, the inclination, the reference frame and the central body. For the Curtis example, 7283 x 10293 km x 153.2 deg (GCRS) means periapsis radius 7283 km, apoapsis radius 10293 km and inclination 153.2 degrees in the geocentric frame. Heliocentric orbits are reported in HCRS and AU, for example 1 x 1 AU x 23.4 deg (HCRS) orbit around Sun in the Earth ephemeris example.

Quantities come back as Astropy objects with units, so convert explicitly: orb.period.to(u.day) gives 686.97 d for the Mars example, and iss.nu.to(u.deg) gives 46.6 degrees before propagation and 163.14 degrees after the 30-minute step. Note that propagation changes the epoch too; check iss_30m.epoch rather than assuming the epoch is unchanged. For a Hohmann transfer, get_total_cost() returns the total velocity change (3.617 km/s in the quickstart example) and get_total_time() the transfer time (about 15,730 s).

The default epoch for orbits created without one is J2000, so supply an epoch when the date matters. The plotting default is the interactive Plotly view; the static matplotlib interface StaticOrbitPlotter is the one suited to publication figures.

Troubleshooting poliastro

  • Install fails or imports break. Check the Python version first. The documented range is 3.8 to 3.10; a newer interpreter is outside what the package supports. Create a separate environment with a supported version.
  • Dependency conflicts. The installation page recommends conda-forge, and mamba is a faster drop-in resolver.
  • Plotly figures do not show in JupyterLab. The installation page notes that Plotly older than version 5 needs Node.js on JupyterLab.
  • Permissions errors. Use a virtual environment rather than sudo pip.
  • First ephemeris call is slow. Setting solar_system_ephemeris.set("jpl") downloads a JPL kernel; the quickstart output shows a download of about 119 MB.
  • A bug nobody will fix. The project is archived, so issues will not be answered. Move to a maintained fork if you need changes.

Free alternatives to poliastro

Both libraries below are listed with details taken from their own project pages. The first is a direct continuation of poliastro; the second is a different toolbox for interplanetary trajectory design.

Package What it is Relation to poliastro Install
hapsira Pure Python astrodynamics library, MIT license, Python 3.8 to 3.11 Fork of poliastro main at archival; its plotter framework was redesigned and is not backwards compatible python -m pip install hapsira or conda install hapsira --channel conda-forge
pykep Toolbox from the European Space Agency Advanced Concepts Team for interplanetary trajectory design; covers multiple-revolution Lambert problems, low-thrust problems and multiple asteroid rendezvous Independent project, different API See the installation section of the pykep documentation

If you are migrating existing poliastro code, hapsira is the closest option, but test the plotting calls, since the plotter changed. Re-run your published results in both environments before switching a project mid-study, and cite whichever package produced the numbers.

What to record when you publish results

Because the package is archived, a methods section should name the exact poliastro version (0.17.0 for the last release), the Python version, and the versions of Astropy and NumPy installed alongside it, and should cite the Zenodo DOI given above. State the epoch and reference frame of every orbit you report, since the printed orbit description includes both. If you export the environment with conda or pip, deposit the environment file with your code so that a reader can rebuild the same set of packages later. When you move a project to hapsira, say so and give the hapsira version, because plotting code written for poliastro may need changes.

The CASRAI guides on flight mechanics and J2 perturbation explain the concepts behind the perturbed-propagation and orbital-element calls shown in the quickstart, which helps when checking that a script reproduces a published result.

Sources

Data: poliastro quickstart worked-example values

Values printed by the official poliastro quickstart for its worked examples (Curtis state vector, Mars at J2000, ISS propagation, Hohmann transfer), compiled into one lookup table from the project's documentation pages as read on 2026-12-03.

Period covered: 2022.

poliastro quickstart worked-example values
ExampleQuantityValueUnit
Curtis example 4.3 state vectorPeriapsis radius7283km
Curtis example 4.3 state vectorApoapsis radius10293km
Curtis example 4.3 state vectorInclination153.2deg
Mars at J2000 (classical elements)Orbital period686.97d
ISS example orbitTrue anomaly at epoch46.6deg
ISS example orbitTrue anomaly after 30 min propagation163.14deg
Hohmann transfer, 700 km circular to 36000 kmTotal velocity change3.617km/s
Hohmann transfer, 700 km circular to 36000 kmTransfer time15729.7s

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about poliastro: Install, Use and Migrate an Archived Orbit Library

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →