Unable to run t.render() from ete3 Python at MacOS Sierra

342 Views Asked by At

I am trying to run the code from ete3 website, but keep getting the following error:

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

Since qt4 is not supported anymore (as stated here), I brew installed qt5. But when I run the ete3 code again, the system is still showing the same ImportError.

Does anyone know the solution to this issue?

1

There are 1 best solutions below

0
On

Indeed, ete3 does not support qt5. If qt4 is no longer an option in macOS Sierra, consider having a conda installation where you can specifically request qt4 and pyqt4 packages. Check this for details: https://github.com/etetoolkit/ete/issues/244