Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
52 views
ubuntu2204
Kernel: Python 3 (system-wide)
! pip install astropy
Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: astropy in /usr/local/lib/python3.10/dist-packages (5.3) Requirement already satisfied: numpy>=1.21 in ./.local/lib/python3.10/site-packages (from astropy) (1.26.4) Requirement already satisfied: pyerfa>=2.0 in /usr/lib/python3/dist-packages (from astropy) (2.0.0.1) Requirement already satisfied: PyYAML>=3.13 in /usr/lib/python3/dist-packages (from astropy) (5.4.1) Requirement already satisfied: packaging>=19.0 in /usr/local/lib/python3.10/dist-packages (from astropy) (23.2) [notice] A new release of pip is available: 25.0.1 -> 25.1.1 [notice] To update, run: python3 -m pip install --upgrade pip
from astropy import units as u
distance = 10 * u.parsec distance_ly = distance.to(u.lyr) print(f"10 parsecs is {distance_ly:.2f}")
10 parsecs is 32.62 lyr