Not finding imported packages when executing the python component via the PythonApplicationManager
I have a python ArmarX component that works as expected when being run from within the Pycharm IDE or from the console (inside the venv).
However, when I use the PythonApplicationManager wrapper inside the ArmarX Gui scenario manager, it fails to import packages.
(open to see the full error message)
[32756][10:46:38.886][ExtApp][ObjectScheduler]: All dependencies of 'PythonApplicationManager' resolved! CMake Error at [...]/armarx/ArmarXCore/source/ArmarXCore/core/system/cmake/FindPackageX.cmake:17 (message): Environment variable for package 'SOEM' was set but the package was not found at '[...]/deps/soem/build'[32628][10:46:38.929][RobotStateMemory][armem::server::ltm::MemoryBase<_CoreSegmentT>::init(...)]: configuration_on_startup: {} [32628][10:46:38.930][RobotStateMemory][ObjectScheduler]: ManagedIceObject 'RobotStateMemory' still waiting for: Armar6Unit [359][10:46:38.937][Simulator][std::cout]: [...]/armarx/simox/VirtualRobot/XML/RobotIO.cpp:1117: Found robot node mapping/[...]/armarx/simox/VirtualRobot/XML/RobotIO.cpp:843: Searching robot: /common/homes/students/daab3/Documents/masterthesis/code/armarx/armarx_integration/robots/armar6/rt/data/armar6_rt/robotmodel/Armar6-SH/Armar6-LeftArm.xml [32754][10:46:39.056][RobotUnitSimulation][std::cout]: [...]/simox/VirtualRobot/XML/RobotIO.cpp:843: Searching robot: [...]/armarx_integration/robots/armar6/rt/data/armar6_rt/robotmodel/Armar6-SH/Armar6-LeftHand-v3.xml [359][10:46:39.098][Simulator][std::cout]: [...]/simox/VirtualRobot/XML/RobotIO.cpp:843: Searching robot: [...]/armarx_integration/robots/armar6/rt/data/armar6_rt/robotmodel/Armar6-SH/Armar6-LeftHand-v3.xml [32754][10:46:39.203][RobotUnitSimulation][std::cout]: [...]/simox/VirtualRobot/XML/RobotIO.cpp:843: Searching robot: [...]/armarx_integration/robots/armar6/rt/data/armar6_rt/robotmodel/Armar6-SH/Armar6-RightArm.xml [505][10:46:39.244][ExtApp][python]: Traceback (most recent call last): File "[...]/python/human_pose_tracking/.venv/lib/python3.6/site-packages/armarx_memory/aron/conversion.py", line 23, in import_aron_ice [505][10:46:39.245][ExtApp][python]: import armarx.aron [505][10:46:39.245][ExtApp][python]: ModuleNotFoundError: No module named 'armarx.aron'; 'armarx' is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "[...]/python/human_pose_tracking/human_pose_tracking/human_pose_tracking.py", line 8, in [505][10:46:39.245][ExtApp][python]: import armarx_memory.aron.conversion as AronConversion [505][10:46:39.245][ExtApp][python]: File "[...]/python/human_pose_tracking/.venv/lib/python3.6/site-packages/armarx_memory/aron/conversion.py", line 33, in [505][10:46:39.246][ExtApp][python]: class Aron: [505][10:46:39.246][ExtApp][python]: File "[...]/python/human_pose_tracking/.venv/lib/python3.6/site-packages/armarx_memory/aron/conversion.py", line 36, in Aron [505][10:46:39.246][ExtApp][python]: ns = import_aron_ice().data.dto [505][10:46:39.246][ExtApp][python]: File "[...]/python/human_pose_tracking/.venv/lib/python3.6/site-packages/armarx_memory/aron/conversion.py", line 25, in import_aron_ice [505][10:46:39.247][ExtApp][python]: from armarx import slice_loader [505][10:46:39.247][ExtApp][python]: ImportError: cannot import name 'slice_loader' [505][10:46:39.272][ExtApp][python]: double free or corruption (out)
I wonder whether it is related to the "configuration" section at https://armarx.humanoids.kit.edu/python/installation.html#installation. From that, I was not sure whether and how a manual configuration is needed after having followed the previous steps of the installation documentation. Therefore, I tried out the following:
Adding packages = armarx
in ~/.armarx/armarx.ini
did not resolve the problem. Using armarx-dev
, which is the package name during installation as opposed to the package name in the import statement, did not resolve the problem either.
There is a closed issue https://gitlab.com/ArmarX/python3-armarx/-/issues/3 that states that (in case it had been merged) the program might use an .ini
file that is located elsewhere. Trying both versions of packages =
in $ARMARX_WORKSPACE/armarx_config/armarx.ini
as well did not resolve the problem.
In the properties of the PythonApplicationManager, the package, the code file path and the venv are set.
What needs to be adjusted to make imports work when using a PythonApplicationManager for execution, provided that the imports already do work when starting the python component from the console or an IDE?