SAS Watchout

When installing the proper SAS build either on Linux or macOS systems, a problem arises during the part that deals with the installation of Python modules. This problem is easily identified because the installation procedure starts looping with messages of the form:


Downloading Python modules needed for SAS from Conda repositories . . .
        ..............................................................................................done
        !!! Some needed Python pkgs are missing unedr the environment: sas_18.0.0. Exiting !!!
        Ready to install the correct Python environment for SAS …
        (Python env sas_18.0.0 will be removed and re-installed for the correct one)


Package plan for package removal in environment /xmmsas_20190531_1155/miniconda3/envs/sas_18.0.0:

The following packages will be REMOVED:

    asn1crypto:         0.24.0-py36_0
    astropy:            2.0.1-np113py36_0
    atomicwrites:       1.3.0-py36_1
    attrs:              19.1.0-py36_1
    blas:               1.0-mkl
    ca-certificates:    2019.8.28-0
    certifi:            2019.9.11-py36_0
    cffi:               1.12.3-py36hb5b8e2f_0
    chardet:            3.0.4-py36_1003
    cryptography:       2.3.1-py36hdbc3d79_0
    cycler:             0.10.0-py36hfc81398_0
    freetype:           2.5.5-2

(list truncated for clarity)

How to fix this problem?

We have found that this problem might arise due to the conflict produced by pre-existing installations of Python 2.X and/or 3.X with the installation of Python being done by the SAS installer. Examples of these preexisting installations could be the Python environments provided by Heasoft, CIAO or any other software tools, but also specific Python tools installed on purpose like the Jupyter Notebooks, etc. Besides these, the Linux and macOS operating systems might have versions of Python already preinstalled, typically under /usr/bin. For example macOS Sierra and Mojave have Python 2.17.10 installed as /usr/bin/python.

To avoid the possible conflict of any of these preexisting installations of Python, we recommend that you disable, at least in the terminal where you are attempting to install the SAS, any trace of previous versions of Python. To do this, please check your shell initialisation scripts (.bashrc, .bash_profile, .cshrc, etc), to see whether you have included any Python initialisation commands. Basically these commands add to the PATH enviroment variable, any directories with Python binaries like the python program itself but also any other related tools like conda, anaconda, miniconda, etc. Besides, these initialisation commands also define the variable PYTHONPATH, to help Python tools find the modules they require to run. To disable all these things, please comment out the respective commands in those shell intitalisation scripts.

Once this is done, ensure the PYTHONPATH variable is undefined and that the command

# which python

returns no answer.

After this, please try to install SAS from the beginning. In case this procedure does not solve your problem and you do not need to have Python with SAS, we have an alternative installation procedure where the installation of Python is skipped.