BMEAutomatedDrive / SUMO-Unity3D-connection

This example demonstrates real-time communication between the microscopic traffic simulator SUMO and the 3D game engine Unity 3D with Python 3.7 based TCP/IP server. Video about the example: https://www.youtube.com/watch?v=4RiJyDnm41Q
Other
98 stars 29 forks source link

CMD running error occured #3

Open xTIGER115 opened 2 years ago

xTIGER115 commented 2 years ago

Use cmd to run Main.exe , and an error occured 'FileNotFoundError: [WinError 2]No such file or directory' can you fix it please? or did I miss some plugins in python? C:\Users\13172\AppData\Local\Temp_MEI127202\sumolib__init.py:28: UserWarning: No module named 'matplotlib' Traceback (most recent call last): File "Main.py", line 68, in File "Main.py", line 25, in init File "TrafficSimulator.py", line 20, in init File "TrafficSimulator.py", line 34, in StartSumo File "traci\init.py", line 95, in start File "subprocess.py", line 775, in init__ File "subprocess.py", line 1178, in _execute_child FileNotFoundError: [WinError 2] No such file or directory。 [20804] Failed to execute script Main thanks a lot.

afzaale01 commented 2 years ago

@xTIGER115 share the command you are using for execution.

xTIGER115 commented 2 years ago

I just did what 'Read.md' said and run Main.py , by the way when the first time I run the 'Main.py' , it said that can't find module 'traci' and 'sumolib' in the directory , so I pasted module which in sumo and ran it . After that this error occured.

`C:\Users\13172>cd /d C:\SUMO\SUMO-Unity3D-connection-master\Python_source

C:\SUMO\SUMO-Unity3D-connection-master\Python_source>python Main.py Traceback (most recent call last): File "Main.py", line 68, in Simulation = SumoUnity(IP, port, SumoNetwork) File "Main.py", line 25, in init self.TrafficSim = TrafficSimulator.TrafficSimulator(self.NetworkName) File "C:\SUMO\SUMO-Unity3D-connection-master\Python_source\TrafficSimulator.py", line 20, in init self.StartSumo() File "C:\SUMO\SUMO-Unity3D-connection-master\Python_source\TrafficSimulator.py", line 34, in StartSumo traci.start(sumoCmd) File "C:\SUMO\SUMO-Unity3D-connection-master\Python_source\traci\main.py", line 168, in start sumoProcess = subprocess.Popen(cmd2, stdout=stdout) File "C:\Program Files\Python37\lib\subprocess.py", line 775, in init restore_signals, start_new_session) File "C:\Program Files\Python37\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] No such file or directory`

Anyway, I have found a method to solve it which change the 'subprocess.py popen part ; shell=TRUE ' in python 3.7 ,but still had error. Help me please...

afzaale01 commented 2 years ago

@xTIGER115 Please verify your network file "sumocfg" path on Main.py line 65 and 68. If you are still facing issue let me know we can have session to resolve problem.

xTIGER115 commented 2 years ago

@afzaale01 I checked the code in Main.py line 63 to 68 `IP = 'localhost' port = 4042 SumoNetwork = 'C:/SUMO/SUMO-Unity3D-connection-master/SUMO_Networks/Rectangle/Network_01.sumocfg' # Name of the network to be opened

INIT

Simulation = SumoUnity(IP, port, SumoNetwork)` It's so weird that whether the directory be changed , the issue still came. Is it the subprocess.py 's problem ?