Anaconda3 scipy.special lambertw function return nan

225 views Asked by At

I am using Anaconda3 2.2.0 Linux x84_64 in Ubuntu 14.04 desktop version. I ran the Anaconda .sh installation file in a fresh Ubuntu environment.

>> from scipy.special import lambertw
>> lambertw(1.7402053563369019e-09)

The expected the output is:

(1.7402053533085873e-09+0j)

However the output is:

(nan+0j)

This problem doesn't exist in Python 2 Anaconda or the Windows version of Anaconda 3.

1

There are 1 answers

0
darthbith On BEST ANSWER

The reason for this error is that Continuum have used older compilers to build the SciPy package for backwards compatibility. In particular, GCC in the neighborhood of version 4.4.7 has some problems with the complex number arithmetic required in this and some other functions. Building the SciPy package yourself, either with pip or manually results in a working install so long as your GCC version is recent enough (version 4.8.4 that comes with Ubuntu 14.04 works, in my experience). Continuum are aware of the issue and working on a fix, see this GitHub issue: https://github.com/ContinuumIO/anaconda-issues/issues/425