Search code examples
pythonscipyenthought

Installed external package (via pip) in Enthought Canopy now import throws ImportError: cannot import name scimath


I was trying to use the lmfit package for doing nonlinear least squares fit and I notices that the Canopy curated version is really old and doesn't have most of the objects. So I followed the instructions here https://support.enthought.com/entries/23389761 as I have done before no problem:

pip install --upgrade setuptools
pip install --upgrade lmfit

Now when I execute the same exact code some "import" statements (I suppose those involved with scimath) give:

ImportError: cannot import name scimath

Seems python standard library imports are fine e.g. import os.

I'm on Ubuntu Linux 14 with Canopy 1.5.2

What happened and how can I fix it and avoid breaking it again.


Solution

  • I solved the problem but I am still not sure why this occurred originally. I went into the package manager and uninstalled scimath reinstalled it and did explicit kernel restarts on my IPython notebooks and interpreters. This fixed it but I don't see why unless somehow the scimath installation was corrupted. Before that I tried restarting application, computer, and reinstalling canopy.