最近,我想在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

最佳答案

我遇到了同样的问题,并卸载了condalxml版本,然后使用pip再次安装。

conda uninstall lxml
pip install lxml

关于python - 在Mac上运行sugiyama.py时出现lxml错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57898440/

10-14 02:18