Closed anjackq closed 3 years ago
Hi there. I have a feeling that you might have two versions of SAGA checked out on your PC. There is a version of SAGA bundled with SUMO. You might be running scenarioFromOSM.py
from a newer version of SAGA which you checked out yourself from git.
Maybe try the following command:
python /home/anjie/Desktop/sumo-1.7.0/tools/contributed/saga/scenarioFromOSM.py --osm merzig.osm --out test
to force Python to use the one bundled with SUMO.
Hi there. I have a feeling that you might have two versions of SAGA checked out on your PC. There is a version of SAGA bundled with SUMO. You might be running
scenarioFromOSM.py
from a newer version of SAGA which you checked out yourself from git.Maybe try the following command:
python /home/anjie/Desktop/sumo-1.7.0/tools/contributed/saga/scenarioFromOSM.py --osm merzig.osm --out test
to force Python to use the one bundled with SUMO.
Hi Abrac,
thanks for the reply. I also tried to use the scenarioFromOSM.py
under the default SUMO directory, but then I got some issues with importing packages like import ptlines2flows
.
Then, I tried to remove the code related to the default-gui.xml
. Therefore, I just comment out the following lines in the scenarioFromOSM.py
:
shutil.copy( '{}/contributed/saga/defaults/default-gui.xml'.format( os.path.join(os.environ['SUMO_HOME'], 'tools')), args.out_dir)
and the code is working.
thanks for the reply. I also tried to use the
scenarioFromOSM.py
under the default SUMO directory, but then I got some issues with importing packages likeimport ptlines2flows
.
I may be wrong, but it seems to me that you've just cloned the SUMO repository, without installing SUMO into your system. Maybe that is why Python is unable to find ptlines2flows.
Hello, the file that you are looking for is in the master: https://github.com/lcodeca/SUMOActivityGen/blob/master/defaults/default-gui.xml In order for the imports to work, you need to have the $SUMO_HOME global variable set and going to the version of SUMO that you want to use. I just pulled the latest development version of SUMO to make it sure, but I can see that version of the file in the contributed tools folder. I'm not sure where does your problem comes from.
Hi, I tried out the simplest example by running scenarioFromOSM.py: In the command line I started with:
python scenarioFromOSM.py --osm merzig.osm --out test
and then I got the following error:
FileNotFoundError: [Errno 2] No such file or directory: '/home/anjie/Desktop/sumo-1.7.0/tools/contributed/saga/defaults/default-gui.xml'
It seems the file "default-gui.xml" is missing the tools file in SUMO, and it does after I checked it. In the "tools/contributed/saga/defaults", only the following file can be found:
' activitygen.json basic.vType.xml duarouter.sumocfg osm.netccfg osm.sumocfg '
Btw, I'm using SUMO 1.7.0 and python 3.8