carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.28k stars 3.65k forks source link

CARLA 0.9.14 - PythonAPI - ModuleNotFoundError: No module named 'carla.libcarla.command' #6414

Open gabrik opened 1 year ago

gabrik commented 1 year ago

Hi,

While writing our own setup script to spawn cars and pedestrians in the simulator, we encountered this issue when trying to import the SpawnActor, or any module under carla.command

Our setup script is based on the /carla/PythonAPI/examples/generate_traffic.py one.

Any suggestion?

CARLA version: 0.9.14 Platform/OS: Ubuntu 20.04 Problem you have experienced: ModuleNotFoundError: No module named 'carla.libcarla.command' What you expected to happen: to import the module Steps to reproduce:

Install carla python from pypi: and try to import a command

pip3 install carla==0.9.14
python3
> from carla.command import SpawnActor
File "/root/utils/prepare-world.py", line 8, in <module>
    from carla.command import SpawnActor, SetAutopilot, FutureActor
File "/usr/local/lib/python3.8/dist-packages/carla/command.py", line 8, in <module>
    from .libcarla.command import *
ModuleNotFoundError: No module named 'carla.libcarla.command'
vagaiprem commented 1 year ago

i am also facing same error plz help anyone in windows environment

NurmaU commented 1 year ago

Solution is here https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py

import carla
SpawnActor = carla.command.SpawnActor
gabrik commented 1 year ago

Solution is here https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py

import carla
SpawnActor = carla.command.SpawnActor

That does not work if CARLA python API (0.9.14) is installed from pip.

Youngzipper commented 1 year ago

i am also facing same error plz help anyone in windows environment

have you found the solution? i encountered the same problem in windows.

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Daraan commented 1 month ago

I've now proposed a working fix for this see: https://github.com/carla-simulator/carla/pull/8161