Why are installed ROS 2 humble python packages split in two directories [closed]

asked 2022-11-29 07:55:44 -0500

GuillaumeB gravatar image

updated 2022-11-29 10:21:25 -0500

Cross-post on robotics.stackexchange.com

Since ROS 2 Humble on Ubuntu 22.04, I noticed that now ROS 2 Humble python packages are split between two directories


For example, tf2_ros is installed under /opt/ros/humble/lib/python3.10/site-packages/tf2_ros
and tf2_py is installed under /opt/ros/humble/local/lib/python3.10/dist-packages/tf2_py

From what I can see, it was not the case before (for Foxy and Galactic, at least). And I was wondering why is it split like this?

This brings the issue that if you source your ROS 2 Humble installation before installing any packages, installing files in local/lib/python3.10/dist-packages this subdirectory won't be added to your PYTHONPATH environment variable.

This force to resource the environment.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by tfoote
close date 2022-12-09 19:24:37.297648



I don't know if I will be able to answer you 100% or not, but here is what I have understood.

dist-packages is the debian-specific directory where apt and friends install their stuff, and site-packages is the standard pip directory.

The package which contains CPP files compiled CPP files (.so) or python script which is using CPP file. will be stored in dist-packages. And the file which executes in python will have site-packages.

I may be wrong.

Ranjit Kathiriya gravatar image Ranjit Kathiriya  ( 2022-11-30 11:06:50 -0500 )edit

There are also python executable files in dist-packages. I could understand that packages not using CMakeLists.txt but pure python were installed in the dist-packages directory. But in the end, all my packages are installed through Debians. So that doesn't explain the "why".

GuillaumeB gravatar image GuillaumeB  ( 2022-12-01 07:43:22 -0500 )edit

Closing this in favor of the StackExchange question to avoid duplication of efforts. https://robotics.stackexchange.com/qu...

tfoote gravatar image tfoote  ( 2022-12-09 19:24:32 -0500 )edit