diff --git a/pyfstat/injection_helper_functions.py b/pyfstat/injection_helper_functions.py
index 04d854fcfd96f72067f30cb8db4ce48041de5416..972115c88fe2bd6cdb7e5bb46fade17eed86f8e5 100644
--- a/pyfstat/injection_helper_functions.py
+++ b/pyfstat/injection_helper_functions.py
@@ -4,9 +4,13 @@
 """
 
 import numpy as np
-from astropy import units as u
-from astropy.coordinates import SkyCoord
-from astropy.time import Time
+import logging
+try:
+    from astropy import units as u
+    from astropy.coordinates import SkyCoord
+    from astropy.time import Time
+except ImportError:
+    logging.warning('Python module astropy not installed')
 
 # Assume Earth goes around Sun in a non-wobbling circle at constant speed;
 # Still take the zero longitude to be the Earth's position during the March