carla
carla copied to clipboard
AttributeError: module 'traci' has no attribute 'sumolib'
CARLA version: 0.9.13 Platform/OS: Linux
Hi there,
when i use sumo to run a co-simulation example in the carla-0.9.13/Co-Simulation/Sumo/examples
folder , and it can run with no error.
But when i use my own .rou.xml file and .sumocfg file to run co-simulation, it said that in /Co-Simulation/Sumo/sumo_integration/sumo_simulation.py", line 304,
, `module 'traci' has no attribute 'sumolib'
After i change the line 304 traci.sumolib.net.readNet(net_file)
to sumolib.net.readNet(net_file)
and no error is reported and the system works normally, and i wanna know is there a small bug in sumo_simulation.py
?

You can try to check the versions of sumo,the new version is different
You can change traci.sumolib.net.readNet to sumolib.net.readNet to fix the error.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
File "/Carla/Co-Simulation/Sumo/sumo_integration/sumo_simulation.py", line 304, in _get_sumo_net sumo_net = traci.sumolib.net.readNet(net_file) AttributeError: module 'traci' has no attribute 'sumolib'
最终是找到了问题所在:
这是因为sumolib是独立的包,不在traci里面,你需要把carla/Co-Simulation/Sumo/sumo_integration/sumo_simulation.py的304行的这一句代码改成sumo_net = sumolib.net.readNet(net_file)