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

'colcon build' Failing While Building Python3 Project on Jetson Xavier NX

asked 2021-05-31 11:08:27 -0500

be12345 gravatar image

updated 2023-04-05 09:03:11 -0500

130s gravatar image

OS: Ubuntu 18.04
Kernel: L4T 4.5.1
Device name: Jetson Xavier NX Developer Kit
ROS Version: ROS2 Foxy (used JetsonHacks repo to install)
Python3 Version: 3.6.9

I've tried building ROS2 from source myself, and I've tried using this repo that's specifically designed to build Foxy from source on Jetson machines. The ROS2 installation seems to have worked just fine, but when trying to run colcon build on my packages, I get the following error:

>Starting >>> gpu-pkg   
Traceback (most recent call last):.6s]  
  File "<string>", line 1, in <module>  
  File "/usr/lib/python3.6/distutils/core.py", line 227, in run_setup  
    script_name)  
RuntimeError: 'distutils.core.setup()' was never called -- perhaps 'setup.py' is not a Distutils setup script?  
--- stderr: gpu-pkg                     
Traceback (most recent call last):  
  File "/usr/lib/python3/dist-packagaes/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 130, in getter  
    desc.path / 'setup.py', env=env)  
  File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 242, in  
 get_setup_information
    setup_py, env=env)  
  File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 283, in  
_get_setup_information
    cwd=os.path.abspath(str(setup_py.parent)), check=True, env=env)  
  File "/usr/lib/python3.6/subprocess.py", line 438, in run  
    output=stdout, stderr=stderr)  
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.  
  ---
>Failed   <<< gpu-pkg [1.76s, exited with code 1]  

>Summary: 0 packages finished [2.53s]  
  1 package failed: gpu-pkg  
  1 package had stderr output: gpu-pkg  
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

2 Answers

Sort by ยป oldest newest most voted
1

answered 2021-06-29 06:02:44 -0500

Does this workaround work for you?

edit flag offensive delete link more
0

answered 2023-04-05 09:09:18 -0500

130s gravatar image

updated 2023-04-05 09:15:35 -0500

I've seen multiple questions that feature this same error message.

RuntimeError: 'distutils.core.setup()' was never called -- perhaps 'setup.py' is not a Distutils setup script?

Something about the entry of entry_points in setup.py is not right. E.g. #q368144, #q381813. You should update your question to add the content of setup.py.

In my case, I had the following when I ran into the error. Solution was to replace ":" before the module name (baa) with a dot:

 entry_points={
        'console_scripts': [
                'setup_app = foo:baa:main',
                ],
        },
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-05-31 11:08:27 -0500

Seen: 719 times

Last updated: Apr 05 '23