简体   繁体   English

无法导入pyspeckit

[英]Can't import pyspeckit

I have a hard time importing and using pyspeckit. 我很难导入和使用pyspeckit。 whenever I try to import it this is the error message I get: 每当我尝试导入它时,这就是我得到的错误消息:

  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'

I think it has something to do with the fact the in python 3.4 there is no div, only truediv and floordiv but even if I change it I get a errors in other places. 我认为这与python 3.4中没有div,只有truediv和floordiv有关,但即使我更改了它,在其他地方也会出现错误。 I haven't found anything to suggest that pyspeckit isn't compatible with python 3.4. 我还没有发现任何暗示pyspeckit与python 3.4不兼容的信息。 Any ideas? 有任何想法吗?

pyspeckit presently does not support python3. pyspeckit目前不支持python3。 For now, you have to use python2.7. 现在,您必须使用python2.7。 If you would like python3 support, help converting the code to be python3 compatible would be welcome! 如果您想要python3支持,欢迎将代码转换为python3兼容!

(I am the main developer of pyspeckit) (我是pyspeckit的主要开发人员)

EDIT: I've raised a corresponding issue for this on github. 编辑:我在github上为此提出了一个相应的问题 Some of the work-in-progress is at this pull request , though it is incomplete. 尽管此请求尚不完整,但仍在此请求中进行中

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

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