1

如果在未安装 PyQT4 时发现人们在使用 ete3 工具时遇到问题的 stackoverflow,这(过去)也适用于我。但是,我现在尝试重新安装一个软件,它一直抱怨“模块”没有属性“Treestyle”。

为了测试是否安装了 PyQT,我运行了这个 python 脚本:

from PyQt4.Qt import PYQT_VERSION_STR
print("PyQt version:", PYQT_VERSION_STR)

哪个打印:

('PyQt version:', '4.12.1')

我得到这个(常见)错误:

Traceback (most recent call last):
  File "/mnt/f/mypy/bin/virtualmicrobes.py", line 1820, in <module>
    sys.exit(main())
  File "/mnt/f/mypy/bin/virtualmicrobes.py", line 1793, in main
    args.start(args)
  File "/mnt/f/mypy/bin/virtualmicrobes.py", line 408, in start_evo_sim
    result = init_and_simulate(simu, intermediate_load_file, _options)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/my_tools/utility.py", line 117, in wrapper
    raise ex_type(message)
AttributeError: 'module' object has no attribute 'TreeStyle' (in subprocess)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/my_tools/utility.py", line 91, in process_func
    ret = func(*args, **kwargs)
  File "/mnt/f/mypy/bin/virtualmicrobes.py", line 295, in init_and_simulate
    sim = sim_mod.create_simulation(**options)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/simulation/Simulation.py", line 1940, in create_simulation
    sim = ODE_simulation(params_dict)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/simulation/Simulation.py", line 1342, in __init__
    super(ODE_simulation, self).__init__(params)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/simulation/Simulation.py", line 86, in __init__
    self.init_graphs()
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/simulation/Simulation.py", line 795, in init_graphs
    show=show, clean=clean, create=create)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/plotting/Graphs.py", line 1188, in __init__
    self.init_phylo_tree_graph(clean=clean)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/plotting/Graphs.py", line 1219, in init_phylo_tree_graph
    show=show, attribute_dict=self.attribute_mapper, create=clean, **kwargs)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/plotting/Graphs.py", line 985, in __init__
    self.init_tree_style_dict() # NOTE: unordered ok
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/plotting/Graphs.py", line 1110, in init_tree_style_dict
    branch_vertical_margin=branch_vertical_margin)
  File "/mnt/f/mypy/local/lib/python2.7/site-packages/VirtualMicrobes/plotting/Graphs.py", line 1083, in make_tree_style
    ts = ete3.TreeStyle() 

注意:这一次我试图在Ubuntu for Windows上安装它,但到目前为止,几乎所有在 Linux 上运行的东西也都在这个上运行。不过,这可能是相关的。

有任何想法吗?

PS 要重现该问题,请执行以下步骤:

$ sudo apt-get install python-qt4
$ virtualenv ~/mypy --system-site-packages
$ source ~/mypy/bin/activate 
$ (mypy) > pip install VirtualMicrobes
$ (mypy) > virtualmicrobes evo --name TestMicrobes >> error

PPS 用户 eyllanesc 确认这是一个“Ubuntu for Windows”问题。不过,我仍在尝试修复它,如果有人可以帮助我弄清楚如何将 pyqt4 包正确链接到我的 virtualenv,那就太好了。我试过用 ln -s 连接原生的,但我没有进一步

4

1 回答 1

0

我有类似的问题。问题可能是您没有安装所有依赖项,并且 ete3 没有告诉您所有依赖项。

您可以查看此代码缺少哪些依赖项:

import ete3
ete3.__file__

运行它,它会告诉你缺少哪些依赖项。请注意,在全部安装之前,您可能需要多次运行它!

于 2018-12-18T14:58:53.190 回答