简体   繁体   English

Python 错误:ImportError:没有名为 FFT 的模块

[英]Python Error: ImportError: No module named FFT

I am using python version 2.7.3 in windows and ubuntu as well as 2.6 in windows.我在 windows 和 ubuntu 中使用 python 版本 2.7.3,在 windows 中使用 2.6。 Why does the following code that imports several modules result in an error in both windows as well as ubuntu?为什么以下导入多个模块的代码在 windows 和 ubuntu 中都会导致错误?

from FFT import *
from pylab import *
from numpy import *
from sampling import *
import pickle
import scipy

ImportError: No module named FFT导入错误:没有名为 FFT 的模块

from FFT import *

我相信这^^^应该是:

from numpy.fft import *

Use fftpack instead fft使用fftpack代替fft

from scipy.fftpack import fft

see the docs查看文档

我发现的唯一解决方案是转向便携式 python http://portablepython.com/wiki/PortablePython2.7.6.1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM