0
$\begingroup$

Rosanswers logo

Hi, I'm trying to install a python module defined in a ros package using the guide defined here. However I find that my package defined in the:

<rospackage>/src/<my_python_pkg>/*.*

is not showing up in the the install/lib/python/dist-utils of my build. I only get the __init__.py from my package installed there.

The contents of my package include multiple subpackages but these folders are not being copied at all. However, two of my scripts that have been defined in the catkin_install_python() function of CMakeLists.txt do show up.

I am using catkin build tools, and my package.xml has a build dependency on rospy, if that matters.

Any guidance would be appreciated.


Originally posted by PeterMilani on ROS Answers with karma: 1493 on 2017-10-15

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Okay, when developing and installing a multilevel package, the package and all subpackages must be included in the setup.py such as:

## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

# fetch values from package.xml
setup_args = generate_distutils_setup(
    packages=['hm_analysis_tools', 
              'pakage_name.subpackage1.subsubpackage',
              'pakage_name.subpackage1.subsubpackage2'],
    package_dir={'': 'src'},
)

setup(**setup_args)

for a package space as:

<ros_package>/
  src/
    package/
       subpackage1/
            subsubpackage1/
            subsubpackage2/

Originally posted by PeterMilani with karma: 1493 on 2017-10-15

This answer was ACCEPTED on the original site

Post score: 6

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.