eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.58k stars 1.44k forks source link

libsumo importError #15277

Open cherryh2021 opened 4 months ago

cherryh2021 commented 4 months ago

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!

behrisch commented 4 months ago

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

cherryh2021 commented 4 months ago

@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.

behrisch commented 1 month ago

@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.