Error in importing Rospy package when calling the the code present in one K8S container from another container

asked 2023-08-01 14:13:16 -0500

Prasun gravatar image

When I am trying to run a Python file present in container 1 from another container, say container 2 which is present in the same pod using kubectl command, it's failing for import rospy error.

However, when I run the same program from container 1, it doesn't fail for Rospy and runs successfully. Both containers are running from the same base image and thus both have rospy package installed.

I am able to run any other program and can even install various python packages into container 1 from container 2 using kubectl command. But somehow it doesn't work when my program in container is importing Rospy package.

Any idea why it's happening??

edit retag flag offensive close merge delete