sumo icon indicating copy to clipboard operation
sumo copied to clipboard

libsumo importError

Open cherryh2021 opened this issue 1 year ago • 2 comments

Hello everyone,

I am trying to run a code of a paper which uses the Libsumo API to interact the SUMO simulator. But I consistently meet with the following error:

Traceback (most recent call last): File "d:\research\Macro_and_micro_co-simulation\EGO-centric-SUMO-main\EGO-centric-SUMO-main\simulate_town_cosim.py", line 5, in from libsumo_parallel import * File "d:\research\Macro_and_micro_co-simulation\EGO-centric-SUMO-main\EGO-centric-SUMO-main\libsumo_parallel.py", line 8, in import libsumo File "E:\SUMO\tools\libsumo_init_.py", line 30, in from .libsumo import vehicle, simulation, person, trafficlight # noqa File "E:\SUMO\tools\libsumo\libsumo.py", line 13, in from . import _libsumo ImportError: DLL load failed while importing _libsumo: The specified module could not be found.

Can anyone help me fix it? Thanks a lot!

cherryh2021 avatar Jul 24 '24 22:07 cherryh2021

@cherryh2021 Please give more information: Especially how you installed libsumo and what is your python and SUMO version?

behrisch avatar Jul 25 '24 06:07 behrisch

@cherryh2021 Please give more information: Especially how you installed libsumo and what is your python and SUMO version?

I install the libsumo by using 'pip install libsumo' demand. My python version is 3.9, sumo version is 1.15.0.

cherryh2021 avatar Jul 25 '24 21:07 cherryh2021

@cherryh2021 Sorry for the delay. Does this mean you installed libsumo via pip install libsumo==1.15.0? Or do you have another sumo installed which is version 1.15.0? If it is the latter please try to uninstall it or at least check whether your SUMO_HOME environment variable points to that installation and if so unset it and try again.

behrisch avatar Sep 30 '24 05:09 behrisch

Closing for lack of feedback. A frequent reason for this kind of error is a missing library. Try to use something like https://github.com/lucasg/Dependencies to analyze the installed libsumo.pyd for missing libraries

behrisch avatar Apr 24 '25 19:04 behrisch