Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Interface with SUMO from python

Try rewrite below:
sumoBinary = "E:/_software/SUMO/bin/sumo-gui"
sumoCmd = [sumoBinary, "-c", "E:/_software/SUMO/test/hello.sumocfg"]


sumo.gui   --->  sumo-gui

Zheya <fzheya@xxxxxxxxx> 於 2018年12月1日 週六 19:04 寫道:
Hi everyone,
This is a stupid question, but I really need help...
I'm tring to interface SUMO from python. But it gives me an
FileNotFoundError.
My code is like this,

import os, sys
if 'SUMO_HOME' in os.environ:
    tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
    sys.path.append(tools)
else:   
    sys.exit("please declare environment variable 'SUMO_HOME'")
##environment variable is correct

sumoBinary = "E:/_software/SUMO/bin/sumo.gui"
sumoCmd = [sumoBinary, "-c", "E:/_software/SUMO/test/hello.sumocfg"]

import sumolib
import traci
import subprocess
traci.start(sumoCmd)
(My sumo version is 1.0.1, so I don't need to start remote port, right??)

The error is as follows
<http://sumo-user-mailing-list.90755.n8.nabble.com/file/t15/%E6%8D%95%E8%8E%B7.jpg>

Thanks in advance,
Zheya





--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top