我为python 2.7.4安装了matplotlib 1.2.0和numpy 1.6.2 当我尝试运行我的代码时,我得到以下导入错误。
Traceback (most recent call last):
File "D:\Python\IQ_polar.py", line 16, in <module>
from matplotlib import pyplot
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 151, in <module>
from matplotlib.rcsetup import (defaultParams,
File "C:\Python27\lib\site-packages\matplotlib\rcsetup.py", line 20, in <module>
from matplotlib.colors import is_color_like
File "C:\Python27\lib\site-packages\matplotlib\colors.py", line 52, in <module>
import numpy as np
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 137, in <module>
import add_newdocs
File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 9, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 4, in <module>
from type_check import *
File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 8, in <module>
import numerictypes as nt
File "C:\Python27\lib\site-packages\numpy\core\numerictypes.py", line 429, in <module>
_set_up_aliases()
File "C:\Python27\lib\site-packages\numpy\core\numerictypes.py", line 412, in _set_up_aliases
allTypes[alias] = allTypes[t]
KeyError: 'timedelta'
产生此错误的部分代码是
import math
import struct
import binascii
from ast import literal_eval
import matplotlib.pyplot as plt
from numpy.fft import fft, fftfreq
import scipy as sp
我觉得它与numpy包有关。我错过了什么?!