eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.55k stars 1.43k forks source link

A problem connecting to SUMO when using google colab #9851

Closed mas3od closed 2 years ago

mas3od commented 2 years ago

Recently I am having a problem using SUMO in Google Colab, it basically refuses to connect. I install SUMO and Traci as instructed in the website

!add-apt-repository ppa:sumo/stable -y
!apt-get update -y
!apt-get install sumo sumo-tools sumo-doc
!pip install traci

but when I try to connect using traci.start or traci.init I get error messages such as

/usr/local/lib/python3.7/dist-packages/traci/main.py:175: UserWarning: Could not connect to TraCI server using port 56489 (TraCI server already finished). Retrying with different port.
  " Retrying with different port.") % (sumoPort, e))

 Retrying in 1 seconds

or

Could not connect to TraCI server at localhost:8813 [Errno 111] Connection refused
 Retrying in 1 seconds

or

Connection closed by SOMU

the confusing par is that I used to connect to SUMO with no problem before, but when I updated colab to colab pro I started having these problems. I tried using different google accounts or installing different Traci/SUMO version and the problem still remain.

is this fixable?

behrisch commented 2 years ago

Are there any further error messages from sumo? Can you try to run sumo from the command line and check whether sumo and traci have the same version?

mas3od commented 2 years ago

Are there any further error messages from sumo? Can you try to run sumo from the command line and check whether sumo and traci have the same version?

Yes they have the same version. i fixed the issue by removing additional files (lane detectors) from the sumocfg file. it is little slow in connecting to SUMO but I think this is a Google Colab issue.

thanks for answering