Why are installed ROS 2 humble python packages split in two directories [closed]
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
/opt/ros/humble/lib/python3.10/site-packages
And
/opt/ros/humble/local/lib/python3.10/dist-packages
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.
Hello,
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, andsite-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 havesite-packages
.I may be wrong.
There are also python executable files in
dist-packages
. I could understand that packages not usingCMakeLists.txt
but pure python were installed in thedist-packages
directory. But in the end, all my packages are installed through Debians. So that doesn't explain the "why".Closing this in favor of the StackExchange question to avoid duplication of efforts. https://robotics.stackexchange.com/qu...