Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] ImportError: No module named traci (python)

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 <sumo-user@xxxxxxxxxxxxxxxxxxxxx>:
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
sumo-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user


Back to the top