我很难导入和使用 pyspeckit。每当我尝试导入它时,这是我收到的错误消息:
File "/Users/sarelg/Documents/NLR/speckit.py", line 1, in <module>
import pyspeckit
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyspeckit/__init__.py", line 11, in <module>
from . import spectrum
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyspeckit/spectrum/__init__.py", line 3, in <module>
from .classes import Spectrum,Spectra,ObsBlock
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyspeckit/spectrum/classes.py", line 23, in <module>
from . import readers
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyspeckit/spectrum/readers/__init__.py", line 90, in <module>
from . import fits_reader
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyspeckit/spectrum/readers/fits_reader.py", line 40, in <module>
scale_action=operator.div, verbose=False, apnum=0, **kwargs):
AttributeError: 'module' object has no attribute 'div'
我认为这与在 python 3.4 中没有 div,只有 truediv 和 floordiv 的事实有关,但即使我改变它,我在其他地方也会出错。我没有发现任何暗示 pyspeckit 与 python 3.4 不兼容的信息。有任何想法吗?