ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

colcon build fails when adding pkg in setup.py

asked 2021-07-05 12:29:05 -0500

Clark_Clark gravatar image

updated 2023-04-05 08:48:19 -0500

130s gravatar image

Greetings: I am new to ROS2 and paid for a tutorial that has 10 sections. I understand everything so far. The course has covered building packages, nodes, topics, and servers. It shows me how to do this in python and C++.

I use Ubuntu 20 and Visual code. The instructor provided source code for all the examples. I'm using Foxy.

QUESTION: Where might I look to resolve colcon build failure when I add the last item in this entry list?

i.e. "add_two_ints_client = my_py_pkg.add_two_ints_client:main

entry_points={
    'console_scripts':[
        "py_node = my_py_pkg.my_first_node:main",
        "robot_news_station = my_py_pkg.robot_news_station:main",
        "smartphone = my_py_pkg.smartphone:main",
        "number_publisher = my_py_pkg.number_publisher:main",
        "number_counter = my_py_pkg.number_counter:main",
        "add_two_ints_server = my_py_pkg.add_two_ints_server:main",
        "add_two_ints_client_no_oop = my_py_pkg.add_two_ints_client_no_oop:main",
        "add_two_ints_client = my_py_pkg.add_two_ints_client:main)"

 ],

I build correctly when I don't add the last line. The code registers clean and I even replaced mine with the instructors.

The result from colcon build is rather cryptic to me. I include it here in hopes someone has an idea. BTW, I did an update and upgrade and verified I have the latest colcon-extensions.

report from "stdout_stderr.log" file

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_core/executor/__init__.py", line 91, in __call__
    rc = await self.task(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_core/task/__init__.py", line 93, in __call__
    return await task_method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/colcon_ros/task/ament_python/build.py", line 51, in build
    setup_py_data = get_setup_data(self.context.pkg, env)
  File "/usr/lib/python3/dist-packages/colcon_core/task/python/__init__.py", line 20, in get_setup_data
    return dict(pkg.metadata[key](env))
  File "/usr/lib/python3/dist-packages/colcon_ros/package_identification/ros.py", line 129, in getter
    return get_setup_information(
  File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 241, in get_setup_information
    _setup_information_cache[hashable_env] = _get_setup_information(
  File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 281, in _get_setup_information
    result = subprocess.run(
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', "import sys;from setuptools.extern.packaging.specifiers import SpecifierSet;from distutils.core import run_setup;dist = run_setup(    'setup.py', script_args=('--dry-run',), stop_after='config');skip_keys = ('cmdclass', 'distclass', 'ext_modules', 'metadata');data = {    key: value for key, value in dist.__dict__.items()     if (        not key.startswith('_') and         not callable(value) and         key not in skip_keys and         key not in dist.display_option_names    )};data['metadata'] = {    k: v for k, v in dist.metadata.__dict__.items()     if k not in ('license_files', 'provides_extras')};sys.stdout.buffer.write(repr(data).encode('utf-8'))"]' returned non-zero exit status 1.
edit retag flag offensive close merge delete

Comments

Oh my! mia culpa. I feel so foolish but also grateful for te answer. Yes, my code works now. I will remember this as it is such a newbie error and I was drilling through the depths of complex reasons that include browsing through "core.py". Again, thank you for taking the time.

Clark_Clark gravatar image Clark_Clark  ( 2021-07-08 10:23:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-07-06 06:31:40 -0500

Ranjit Kathiriya gravatar image

updated 2021-07-06 06:33:23 -0500

"add_two_ints_client = my_py_pkg.add_two_ints_client:main)"

Can you please! have a look at extra " ) " remove this and try to build it again. I think this will solve your problem. If it does not solve your problem feel free to drop a comment.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-07-05 12:29:05 -0500

Seen: 726 times

Last updated: Apr 05 '23