在Mac上运行sugiyama.py时出现lxml错误

时间:2019-09-12 01:00:00

标签: python pip lxml conda flow-project

最近我想在Mac上尝试流项目,在安装所有要求并尝试运行python examples / sumo / sugiyama.py之后,出现如下错误。你能帮我解决吗?

Traceback (most recent call last):
  File "examples/sumo/sugiyama.py", line 7, in <module>
    from flow.core.experiment import Experiment
  File "/Users/voanhkha/Desktop/flow/flow/core/experiment.py", line 9, in <module>
    from flow.core.util import emission_to_csv
  File "/Users/voanhkha/Desktop/flow/flow/core/util.py", line 6, in <module>
    from lxml import etree
ImportError: dlopen(/Users/voanhkha/anaconda3/envs/flow/lib/python3.6/site-packages/lxml/etree.cpython-36m-darwin.so, 2): no suitable image found.  Did find:
    /Users/voanhkha/anaconda3/envs/flow/lib/python3.6/site-packages/lxml/etree.cpython-36m-darwin.so: unknown file type, first eight bytes: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    /Users/voanhkha/anaconda3/envs/flow/lib/python3.6/site-packages/lxml/etree.cpython-36m-darwin.so: unknown file type, first eight bytes: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,并卸载了conda的{​​{1}}版本,然后使用lxml再次安装了它。

pip