Thursday, May 24, 2018

Reasons to update to Sherpa 4.10.0 (fun with conda)

A quick note about our conda packages for Sherpa

It looks like the conda environment has changed again, which means that the Sherpa 4.9.1 (and earlier) packages we provide for Sherpa may stop working. At least if you are using macOS with Python 3.5 or Python 3.6.

An example of the problem

On macOS (any version), create a new conda environment with sherpa 4.9.1 and the latest version of python:

$ conda create -n sherpa-macos-issue -c sherpa \
          python=3.6.5 sherpa=4.9.1
$ source activate sherpa-macos-issue

At this point, trying to load a Sherpa module will result in the following:

$ python -c "from sherpa.astro.ui import *"
Fatal Python error: PyThreadState_Get: no current thread

Abort trap: 6

This is obviously "not good"™.

This does not appear to be a problem for people using Python 2.7, but we suggest updating to Python 3.5 (or later) as we will be dropping support for Python 2.7 in the not too-distant future.

Solutions

The preferred solution is to update to Sherpa 4.10.0, since they were built with a recent conda installation, and so do not suffer this problem.

$ conda install -c sherpa sherpa=4.10

For users with a source build of Sherpa within a conda environment, remove the original build before re-building, or switch to the binary install above.

If upgrading is not possible, then downgrading the Python version appears to work - that is, use Python version 3.6.1 or 3.5.3.

$ conda install python=3.6.1

$ conda install python=3.5.3

Please let the Sherpa team know, via the Sherpa GitHub page, if there are problems with either of the above approaches.

Happy fitting and modelling!

No comments:

Post a Comment