On Apr 19, 2017, at 12:38 PM, Lockhart, Thomas G (398I) <[email protected]<mailto:[email protected]>> wrote:
On Apr 19, 2017, at 11:41 AM, Jiyao Li <[email protected]<mailto:[email protected]>> wrote: Dear Expert, I am using traCI, it works well under Python 2.7.11. but it doesn't work under python 3.5.2, and the errors of prompt are below. So what's wrong with it? Not an expert, but… It looks like some exceptions in the code are not yet compatible with Python 3. Try changing the line to “raise ValueError(‘edge for this lane not yet defined’)” which should work with both Python 2 and Python 3. This has already been fixed in current sources. There are very few cases left to be adjusted: $ find . -name '*.py*' -exec egrep ' raise [^,]+, ' {} \; -print raise ImportError, "Required dependencies numpy or OpenGL not present" ./tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py raise ImportError, "Required dependency OpenGL not present" ./tools/contributed/sumopy/agilepy/lib_wx/test_glcanvas.py raise IndexError, "smallest of empty priorityDictionary" ./tools/contributed/sumopy/coremodules/network/routing.py raise StandardError, 'Start and/or end points are not leagal for flaeche %s %s' % ( raise StandardError, 'Start point must not be equal to end point' ./tools/projects/vehicles2d/main.py raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" raise "Hmmm, unknown stream??" ./tools/sumolib/scenario/pop2.py raise TraCIException(prefix[1], _RESULTS[prefix[2]], err) - Tom I’m sure the developers would welcome patches to adjust these statements throughout the code. hth - Tom Thanks, Jiyao Traceback (most recent call last): File "C:/sumo_traffic/tutorial/city_mobil/createNet.py", line 26, in <module> from constants import * File "C:\sumo_traffic\tutorial\city_mobil\constants.py", line 49, in <module> from sumolib import checkBinary File "C:\Program Files (x86)\DLR\Sumo\tools\sumolib\__init__.py", line 37, in <module> from . import files, net, output, sensors, shapes File "C:\Program Files (x86)\DLR\Sumo\tools\sumolib\net\__init__.py", line 37, in <module> from . import lane, edge, node, connection, roundabout File "C:\Program Files (x86)\DLR\Sumo\tools\sumolib\net\lane.py", line 109 raise ValueError, 'edge for this lane not yet defined' ^ SyntaxError: invalid syntax ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org<http://Slashdot.org>! http://sdm.link/slashdot _______________________________________________ sumo-user mailing list [email protected]<mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/sumo-user ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org<http://slashdot.org/>! http://sdm.link/slashdot _______________________________________________ sumo-user mailing list [email protected]<mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/sumo-user ------------------------------------------------------------------------------ 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
