You need to insert the correct path to your sumo tools in this line:
>>> sys.path.append(os.path.join('c:', os.sep, 'whatever', 'path', 'to',
'sumo', 'tools'))

2018-05-02 17:31 GMT+02:00 Abeer Hakeem via sumo-user <
[email protected]>:

> Hello,
>
>
> I'm trying to apply the following commands in python but I always get the
> error below, (please help)
>
>
> >>> 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'")
>
> ...
>
> >>> sys.path.append(os.path.join('c:', os.sep, 'whatever', 'path', 'to',
> 'sumo', 'tools'))
>
> >>> import subprocess
>
> >>> PORT=8815
>
> >>> sumoBinary= "/opt/local/bin/sumo-gui"
>
> >>> sumoProcess = subprocess.Popen([sumoBinary, "-c",
> "/Users/abeerhakeem/Documents/MyResearch/NewMap/NY_lastVersion_MFPS/MFPS/
> TAPASCologne-0.32.0/cologne6to8.sumocfg", "--remote-port", str(PORT)],
> stdout=sys.stdout, stderr=sys.stderr)
>
> >>> Loading configuration... done.
>
>
> >>> PORT=8815
>
> >>> sumoBinary= "/opt/local/bin/sumo-gui"
>
> >>> sumoProcess = subprocess.Popen([sumoBinary, "-c",
> "/Users/abeerhakeem/Documents/MyResearch/NewMap/NY_lastVersion_MFPS/MFPS/
> TAPASCologne-0.32.0/cologne6to8.sumocfg", "--remote-port", str(PORT)],
> stdout=sys.stdout, stderr=sys.stderr)
>
> >>> Loading configuration... done.
>
>
> >>> import traci
>
> Traceback (most recent call last):
>
>   File "<stdin>", line 1, in <module>
>
> ImportError: No module named 'traci'
>
>
>
> Thanks for the response in advance.
>
> Regard,
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> sumo-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sumo-user
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

Reply via email to