ModuleNotFoundError: No module named 'simulation'

Hello all,

ich installed the following required packages, and sumo for SUMO interface and I am using python 3.8,

pip install commonroad-all

However, when I follow the tutorial, I get this error:

ModuleNotFoundError: No module named 'simulation'

Where can I get the simulation module?

Thank you!

1 Like

Are you referring to the interactive scenario tutorial?

if yes, you also need to use the installation script for the setup.

Thank you for your quick reply.

I used the installation script bash install.sh -e cr37 --sumo.

But I met a new error:

ModuleNotFoundError: No module named 'libsumo.libsumo'

I am using Pycharm and I have rebooted the PC. But I did not find that the SUMO_PATH environment variable has been written into the ~/.profile file.

Do I miss some important steps?

The installation command you used looks correct.
Does it work when you add

export SUMO_HOME=$SUMO_HOME
export PATH=$PATH:$SUMO_HOME/bin

manually to ~/.profile, where $SUMO_HOME should be replace with the path to SUMO?

I can now find the SUMO_HOME in .profile, and the sumo path is a part of $PATH.

But I still get the same error:

     27 from traci import connection, constants, exceptions, _vehicle, _person, _trafficlight, _simulation  # noqa
     28 from traci.connection import StepListener  # noqa
---> 29 from .libsumo import vehicle, simulation, person, trafficlight  # noqa
     30 from .libsumo import TraCIStage, TraCINextStopData, TraCIReservation, TraCILogic, TraCIPhase, TraCIException  # noqa
     31 from .libsumo import TraCICollision, TraCISignalConstraint  # noqa

ModuleNotFoundError: No module named 'libsumo.libsumo'

I am using Pycharm and from the python console I can import libsumo.

Do you have some other suggestions?

Thank you!

Hi,

I followed the instructions in tum-cps / commonroad-sumo-interface · GitLab on another machine with Ubuntu 20.04, Python 3.8, sumo Version 1.12.0 and Pycharm.

I got the same error.

Is it because of an update from the SUMO side?

Thank you!

Can you try sumo 1.14?
If it doesn’t work you can also try out the dockerized version of SUMO as described here.

I installed and added the SUMO_HOME for sumo 1.14 and removed sumo 1.12, now it works. Thank you!

BTW, the video shows that there seems to be a visualization problem (see right upper corner).

This is caused by the latest version of matplotlib.
Please install matplotlib < 3.16.

Hello,
I got the same error "No module named ‘libsumo.libsumo’ " when running with pycharm. I have checked my SUMO_HOME path in .profile, and try sumo1.14, but I still can not run it with pycharm. But with jupyter notebook or terminal, it works well.
Could you please help me? Thank you!

Hello,

Thanks for your message. Since it’s working with your Jupyter notebook and terminal, the SUMO and sumo-interface installation seem to be correct. The problem is probably related to your python environment configuration. I would recommend you to try the same python environment which you are using in the terminal as the python interpreter in PyCharm. Also, for troubleshooting, you should compare the Python system path in the different environments (import sys; print(sys.path)).

For further questions regarding the python configuration in PyCharm, please refer to their support page.

Best regards,
Florian