0

Sorry for this dumb question, but since I am a total newbie I have no idea as to what is wrong. I am trying to connect my python console to the GUI interface version of SUMO. But this error keeps popping up. Again sorry for this dumb question.

I tried changing the test configuration file. Still doesn't work.

sumoBinary = "C:\Program Files (x86)\Eclipse\Sumo\bin\sumo-gui"
sumoCmd = [sumoBinary, "-c", "osm.cfg"]
import traci
traci.start(sumoCmd) 

Error:

  File "<input>", line 2, in <module>
  File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\__init__.py", line 95, in start
    sumoProcess = subprocess.Popen(cmd + ["--remote-port", str(port)])
  File "D:\Anaconda\envs\untitled1\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "D:\Anaconda\envs\untitled1\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
  • The problem is using single \ in path: https://stackoverflow.com/questions/2953834/windows-path-in-python – orhtej2 Aug 27 '19 at 18:11

1 Answers1

0

I'm fairly certain that your file path is incorrect. You have a space in it between program files and x86 so it doesn't understand it. Instead try

sumoBinary = "C:\"Program Files (x86)"\Eclipse\Sumo\bin\sumo-gui"

This may still not be the correct path depending on your specific file, but something like is likely to be the culprit.

The easiest way to know your exact file path that you need to use is to navigate to it via the terminal.

Mike
  • 1,471
  • 12
  • 17