我很难导入和使用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不兼容的事情。有什么想法吗?
答案 0 :(得分:1)
pyspeckit目前不支持python3。现在,你必须使用python2.7。如果您想要python3支持,欢迎将代码转换为python3兼容,欢迎使用!
(我是pyspeckit的主要开发者)
编辑:我已经在github上为此提出了相应的issue。一些正在进行的工作在this pull request,但不完整。