Robotics StackExchange | Archived questions

how to install real python modules in dist-packages?

I've followed this documentation on how to use setup.py and CMakeLists.txt to use python modules in a catkin package. It pretty much "works" but I've observed that it actually puts a fake __init__.py into python2.7/dist-packages/my_package, which will modify my python path at runtime to include my module's src dir. This works OK for actually running the code, but static code analysis (eg. pylint) doesn't execute the code that changes the path and therefore can't find my modules.

I've noticed that other ROS python packages have the real python files in dist-packages so my question is how do I do that? I suspect that it has something to do with the catkin build type being Release, but I'm pretty sure my build script is already using RelWithDebInfo.

Asked by zacwitte on 2019-07-03 12:28:55 UTC

Comments

What documentation are you following?

Asked by jayess on 2019-07-03 13:06:30 UTC

@jayess, sorry, forgot to link that. http://docs.ros.org/kinetic/api/catkin/html/howto/format2/installing_python.html

Asked by zacwitte on 2019-07-03 13:56:29 UTC

Afaik "real python files" will only be copied to an install space with catkin.

Either run catkin_make install or configure catkin build to also run the install phase of everything (catkin config --install).

Asked by gvdhoorn on 2019-07-03 15:12:17 UTC

Answers