无法在MacOS Sierra的ete3 Python中运行t.render()

时间:2016-10-22 00:41:17

标签: python qt ete3

我正在尝试从ete3网站运行代码,但不断收到以下错误:

ImportError                               Traceback (most recent call last)
<ipython-input-12-a0ac9cfa4061> in <module>()
      1 from ete3 import Tree
      2 t = Tree( "((a,b),c);" )
----> 3 t.render("mytree.png", w=183, units="mm")

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ete3/coretype/tree.pyc in render(self, file_name, layout, w, h, tree_style, units, dpi)
   1352         """
   1353 
-> 1354         from ..treeview import drawer
   1355         if file_name == '%%return':
   1356             return drawer.get_img(self, w=w, h=h,

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ete3/treeview/__init__.py in <module>()
     40 
     41 
---> 42 from .main import *
     43 from .faces import *
     44 from .svg_colors import *

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ete3/treeview/main.py in <module>()
     46 from sys import stderr
     47 
---> 48 from PyQt4.QtGui import *
     49 from PyQt4 import QtCore
     50 

ImportError: No module named PyQt4.QtGui

由于不再支持qt4(如here所述),我酿造了qt5。但是当我再次运行ete3代码时,系统仍然显示相同的ImportError。

有谁知道这个问题的解决方案?

1 个答案:

答案 0 :(得分:0)

确实,ete3不支持qt5。 如果qt4不再是macOS Sierra中的选项,请考虑使用conda安装,您可以专门请求qt4和pyqt4包。 查看详细信息: http://frontendcollisionblog.com/mongodb/2016/01/24/mongoose-populate.html