【问题标题】:Fail to run SUMO Tutorials/TraCI4Traffic LightsSUMO 教程/TraCI4Traffic Lights 运行失败
【发布时间】:2018-12-05 09:30:47
【问题描述】:

我尝试运行 SUMO 教程。

这是网站:

http://sumo.dlr.de/wiki/Tutorials/TraCI4Traffic_Lights

我输入了这个命令:

sumo-gut data/cross.sumocfg

然后我跑了:

python3 runner.py

然后出现错误:

Traceback (most recent call last):
  File "runner.py", line 122, in <module>
    traci.start([sumoBinary, "-c", "data/cross.sumocfg","--tripinfo-output", "tripinfo.xml"])
  File "/Users/xieweian/sumo/tools/traci/__init__.py", line 96, in start
    sumoProcess = subprocess.Popen(cmd + ["--remote-port", str(port)])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sumo-guiD': 'sumo-guiD'

我应该怎么做才能运行这个演示?

【问题讨论】:

    标签: python sumo


    【解决方案1】:

    无需手动启动 sumo-gui,runner.py 应该会为您执行此操作,但它似乎找不到您的 sumo-guiD。但显然您已经修改了脚本或使用了一些修改后的版本,因为在最新版本中,脚本查找 sumo-gui 而不是 sumo-guiD。还请检查您的 SUMO_HOME 环境变量是否已设置并指向正确的目录。您正在运行哪个版本的相扑?

    【讨论】:

      【解决方案2】:
      export SUMO_HOME=/usr/share/sumo
      

      它在 Ubuntu 中暂时适用于我。每次运行.py python,我都要在上面添加这个命令

      【讨论】:

      • 如果您需要始终添加路径,您可以在~/.profile~/.bash_profile 文件中设置路径
      猜你喜欢
      • 1970-01-01
      • 2018-02-25
      • 2016-03-01
      • 2015-08-15
      • 1970-01-01
      • 1970-01-01
      • 2014-01-30
      • 1970-01-01
      • 2018-07-02
      相关资源
      最近更新 更多