Cannot import name 'StepListener' from 'traci.connection'

Hello, everyone.I’m here for some help. When I run the the first part Preparation of Tutorial: Interactive Scenario Simulation, something went wrong.

I work in Ubuntu18.4. And I have installed sumo and sumocr. There is some detail information:

sumocr 2021.5
tensorboard 1.15.0
tensorflow 1.15.0
tensorflow-estimator 1.15.1
termcolor 1.1.0
terminado 0.13.1
testpath 0.5.0
tomli 2.0.1
tornado 6.1
tqdm 4.62.3
traitlets 5.1.1
triangle 20220202
typing-extensions 3.10.0.2
urllib3 1.26.8
utm 0.7.0
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 1.2.3
Werkzeug 0.16.1
wheel 0.37.1
widgetsnbextension 3.5.2
wrapt 1.13.3
zipp 3.7.0
(cr37) biang@ubuntu:~/commonroad-rl$ sumo
SUMO Version 0.32.0
Build features: x86_64-pc-linux-gnu TRACI PROJ GDAL GUI
Copyright (C) 2001-2017 German Aerospace Center (DLR) and others; http://sumo.dlr.de
License EPLv2: Eclipse Public License Version 2 https://eclipse.org/legal/epl-v20.html
Use --help to get the list of options.

Your Sumo version 0.32.0 is outdated, please install the latest version (1.12.0).

Thank you for your suggestion. I have installed the latest Sumo(1.12.0) first, then I run this command again in commonroad-interactive-scenarios folder:

bash install.sh -e cr37 --sumo

But when I run the Tutorial again, another problem occurred


The dependency packages information is:

libsumo 1.12.0.post0
libtraci 1.12.0.post0
sumocr 2021.5
sumolib 1.12.0.post0

Eclipse SUMO sumo Version 1.12.0

Do you have any idea about that.

Hi,

i got the same problem as you, and i am using MacOS.

How did you retrieve the package information above? Are you sure your script was executed in the cr37 environment? Because in the install.sh script there was still an older version < 1.12.0 of SUMO listed, I just updated it. So I assume that the environment where libsumo1.12.0 is installed is not cr37 (which is the conda environment where the script installs everything). Or maybe the SUMO_HOME variable is not set correctly in the environment where you run the script. Perhaps try uninstalling the previously installed version of SUMO and run the install script afterward. Or if only libsumo is the problem, try installing it via pip install libsumo=1.12.0.

Hello, I have solved the problem and run the first Tutorial successfully. Now I explain the whole thing.
The libsumo is the problem.
I run the pip list in the cr37 environment and get package information above. And I have uninstalled the previously version of SUMO. So following your suggestion, I try to uninstall the libsumo and install the libsumo again. But when I run pip uninstall libsumo, some error information tells me

no uninstall file found

Then I run pip show libsumo, and find this:

(cr37) biang@ubuntu:~$ pip show libsumo
Name: libsumo
Version: 1.12.0.post0
Summary: The python version of the libsumo API to communicate with the traffic simulation Eclipse SUMO
Home-page: Libsumo - SUMO Documentation
Author: DLR and contributors
Author-email: sumo@dlr.de
License: EPL-2.0
Location: /usr/share/sumo/tools
Requires: traci
Required-by:

I guess this package is built by the previous SUMO. So I go to the folder /usr/share/sumo/tools to remove libsumo and libtraci:

sudo rm -rf libsumo
sudo rm -rf libsumo.egg-info
sudo rm -rf libtraci
sudo rm -rf libtraci.egg-info

Then I run pip install libsumo and pip install libreaci to install the packages.
Finally, I run the Tutorial successfully.

Thanks for your helpful suggestions!

After I running pip install libsumo , I got an error message.

ImportError: dlopen(/Users/chenzewen/opt/anaconda3/envs/commonroad-py37/lib/python3.7/site-packages/libsumo/_libsumo.so, 2): Library not loaded: /Users/runner/hostedtoolcache/Python/3.7.12/x64/lib/libpython3.7m.dylib
Referenced from: /Users/chenzewen/opt/anaconda3/envs/commonroad-py37/lib/python3.7/site-packages/libsumo/_libsumo.so
Reason: image not found

There seems to be no way to run the so. file in the macOS environment.

SUMO supports Mac, so this is probably related to another problem. Since it’s related to SUMO and we don’t have macOS, you will probably find help in the SUMO community. If you find a solution, feel free to share it here.

hi, do you have any idea about that, thanks