From 9208e5eb6799b3aed7bb8631c66dfcb9d3d52fc7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 18 Sep 2024 16:03:34 +0200 Subject: [PATCH 1/3] libcarla as submodule --- PythonAPI/carla/src/Commands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PythonAPI/carla/src/Commands.cpp b/PythonAPI/carla/src/Commands.cpp index 3d78fbe479a..1185da5f7d4 100644 --- a/PythonAPI/carla/src/Commands.cpp +++ b/PythonAPI/carla/src/Commands.cpp @@ -50,7 +50,7 @@ void export_commands() { using ActorPtr = carla::SharedPtr; - object command_module(handle<>(borrowed(PyImport_AddModule("libcarla.command")))); + object command_module(handle<>(borrowed(PyImport_AddModule("carla.libcarla.command")))); scope().attr("command") = command_module; scope submodule_scope = command_module; From cec536394dec80cc8065dcf87bcd2a376b56831b Mon Sep 17 00:00:00 2001 From: Daniel Sperber Date: Mon, 20 Oct 2025 10:35:00 +0200 Subject: [PATCH 2/3] add command to sys.modules --- PythonAPI/carla/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PythonAPI/carla/__init__.py b/PythonAPI/carla/__init__.py index ac827155693..e5b60b5f0de 100644 --- a/PythonAPI/carla/__init__.py +++ b/PythonAPI/carla/__init__.py @@ -1 +1,8 @@ from .carla import * + + +# Allow from carla.command import ... +import sys + +sys.modules["carla.command"] = command +del sys From 09e10283f33510eaa94d73706602ba47abb256f9 Mon Sep 17 00:00:00 2001 From: Daniel Sperber Date: Mon, 20 Oct 2025 10:43:32 +0200 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb106a53a28..5e708fa0e75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Added actor description as Actor TAGs * Create class with functions to import points and polylines from satellite segmentation (#8946, #8949 #8950) +* Python API: Allow `from carla.command import ...` (#9367) ## CARLA 0.10.0