Obspy can't find np.fft.fftpack


I am running obspy version 1.0.3 under anaconda, and am using numpy version 1.12.1. My OS is Ubuntu 14.04. A friend sent me an obspy script that does instrument deconvolution using tr.remove_response, but it encounters the following error:

File “/home/ryanign/ANU-RSES-u5484353/Academics/PhD_research/02_HistoricalTsunamis/1992_Flores/seismic/neic/get_data_neic.py”, line 544, in getobs

File “”, line 2, in remove_response

File “/home/ryanign/APPS/anaconda/lib/python2.7/site-packages/obspy/core/trace.py”, line 232, in _add_processing_info
result = func(*args, **kwargs)

File “/home/ryanign/APPS/anaconda/lib/python2.7/site-packages/obspy/core/trace.py”, line 2596, in remove_response

File “/home/ryanign/APPS/anaconda/lib/python2.7/site-packages/obspy/core/util/misc.py”, line 511, in limit_numpy_fft_cache
if not hasattr(np.fft.fftpack, cache):

AttributeError: ‘module’ object has no attribute 'fftpack

When I import numpy.fft, I can see that it indeed does not have the package fftpack. Can anyone suggest a way to work around this problem?


  • Phil

Hi Phil,

I just tried current conda packages (Linux 64bit) for numpy (version
1.12.1) from both defaults and conda-forge channel and in both the
numpy.fft.fftpack submodule is present.

Can you do..?
- conda list numpy
- python -c 'import numpy; print(numpy.__version__);
print(numpy.__file__); print(numpy.fft.fftpack)'

You could also try to remove numpy ("conda remove --force numpy"; option
--force to not remove other packages that depend on numpy) and install
it again ("conda install --force numpy"), this might fix it if your
package installation is broken somehow..