diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -21,9 +21,7 @@ with open(os.path.join(here, version_filename)) as version_file:
 
 # change setup.py for readthedocs
 on_rtd = os.environ.get('READTHEDOCS') == 'True'
-install_requires=['pandas', 'numpy',  'sgp4', 'pyEphem', 'requests',
-                  'xarray',
-                  # remaining packages are excluded if on ReadTheDocs
+install_requires=['xarray', 'pandas', 'numpy',  'sgp4', 'pyEphem', 'requests',     
                   'pysatCDF', 'apexpy', 'aacgmv2', 'pysatMagVect', 
                   'madrigalWeb', 'h5py', 'PyForecastTools']
 
@@ -32,6 +30,7 @@ install_requires=['pandas', 'numpy',  'sgp4', 'pyEphem', 'requests',
 #     # TODO Remove when pyglow works in python 3
 #     install_requires.append('pyglow')
 
+# all packages after pysatCDF are excluded if on ReadTheDocs
 if on_rtd:
     # read the docs doesn't do Fortran
     # remove pysatCDF through h5py
Update setup.py

Moved xarray import to the front. Read the Docs isn't getting the correct pandas version and can't handle self upgrading for some reason.