Autocomplete in Eclipse with Catkin and Python Packages

asked 2014-10-15 13:29:21 -0500

Peaches491 gravatar image

So, i'm attempting to write a Python Module within a ROS Package (using Catkin)

I have the following directory structure

    - src
        - package_name (again)
            - module_1
            - module_2
            - module_3

In my CMakeLists, I have uncommented the catkin_python_setup() and catkin_package() calls. However, I am not seeing any of these modules come up when I use autocomplete in eclispe. I've edited my eclipse .desktop file with the bash -i -c eclipse command.

Here are the contents of my

#!/usr/bin/env python

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

d = generate_distutils_setup(
    packages=['heres_how_python_utils.conversions', '', 'heres_how_python_utils.json'],
    package_dir={'': 'src'}


Any thoughts as to why this might not be working? I have other python modules set up in the same workspace which are autocompleting nicely.


edit retag flag offensive close merge delete


I've found that the command sets up the PYTHONPATH to use the /devel directory. However, in this directory, /package_name only has an __init__ file, which has a bunch of auto-generated import code in it. How can I set the PYTHONPATH to use the src directory instead?

Peaches491 gravatar image Peaches491  ( 2014-10-15 14:47:53 -0500 )edit

It must be set to the devel folder if you have any generated code (like messages or services). Otherwise you can manually set it to the source folder. The files in the devel folder will probably mess with any kind of tab completion stuff.

William gravatar image William  ( 2014-10-15 15:23:16 -0500 )edit