Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RuntimeError: 'distutils.core.setup()' was never called; Failed to find exported target names in #159

Open
eonsstills0r opened this issue Oct 2, 2022 · 3 comments

Comments

@eonsstills0r
Copy link

I'm following this instruction: ROS 2 User Guide (PX4-ROS 2 Bridge).
If I ran source build_ros2_workspace.bash I have the following error. After that bash exits with error code 1:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 277, in run_setup
    raise RuntimeError(
RuntimeError: 'distutils.core.setup()' was never called -- perhaps 'setup.py' is not a Distutils setup script?
[2.674s] ERROR:colcon.colcon_core.package_identification:Exception in package identification extension 'python_setup_py' in 'lib/python3/dist-packages/numpy/lib': 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.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_core/package_identification/__init__.py", line 142, in _identify
    retval = extension.identify(_reused_descriptor_instance)
  File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 48, in identify
    config = get_setup_information(setup_py)
  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.

If I run build_ros2_workspace.bash with bash debugger, I have the following error:

--- stderr: px4_ros_com
CMake Error at /code/src/install/px4_msgs/share/px4_msgs/cmake/ament_cmake_export_targets-extras.cmake:18 (message):
  Failed to find exported target names in
  '/code/src/install/px4_msgs/share/px4_msgs/cmake/px4_msgs__rosidl_generator_cExport.cmake'
Call Stack (most recent call first):
  /code/src/install/px4_msgs/share/px4_msgs/cmake/px4_msgsConfig.cmake:41 (include)
  CMakeLists.txt:46 (find_package)


---
Failed   <<< px4_ros_com [0.93s, exited with code 1]

Summary: 1 package finished [3min 48s]
  1 package failed: px4_ros_com
  1 package had stderr output: px4_ros_com
@eonsstills0r
Copy link
Author

Actually, the first error is not full. The error starts with this error:

penjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)
Traceback (most recent call last):
  File "bit_generator.pyx", line 40, in numpy.random.bit_generator
  File "/usr/lib/python3.8/secrets.py", line 20, in <module>
    from random import SystemRandom
ImportError: cannot import name 'SystemRandom' from partially initialized module 'random' (most likely due to a circular import) (/usr/lib/python3/dist-packages/numpy/random/__init__.py)


@eonsstills0r
Copy link
Author

The error change a bit after I removed log build folders:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 16, in <module>
    import setuptools.version
  File "/usr/local/lib/python3.8/dist-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 33, in <module>
    import email.parser
  File "/usr/lib/python3.8/email/parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "/usr/lib/python3.8/email/feedparser.py", line 27, in <module>
    from email._policybase import compat32
  File "/usr/lib/python3.8/email/_policybase.py", line 9, in <module>
    from email.utils import _has_surrogates
  File "/usr/lib/python3.8/email/utils.py", line 28, in <module>
    import random
  File "/usr/lib/python3/dist-packages/numpy/random/__init__.py", line 181, in <module>
    from . import _pickle
  File "/usr/lib/python3/dist-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
  File "__init__.pxd", line 206, in init numpy.random.mtrand
  File "/usr/local/lib/python3.8/dist-packages/numpy/__init__.py", line 151, in <module>
    from . import random
  File "/usr/local/lib/python3.8/dist-packages/numpy/random/__init__.py", line 180, in <module>
    from . import _pickle
  File "/usr/local/lib/python3.8/dist-packages/numpy/random/_pickle.py", line 2, in <module>
    from ._philox import Philox
  File "_philox.pyx", line 1, in init numpy.random._philox
  File "bit_generator.pyx", line 38, in init numpy.random.bit_generator
  File "/usr/lib/python3.8/secrets.py", line 20, in <module>
    from random import SystemRandom
ImportError: cannot import name 'SystemRandom' from partially initialized module 'random' (most likely due to a circular import) (/usr/lib/python3/dist-packages/numpy/random/__init__.py)

@eonsstills0r
Copy link
Author

Also, I want to add that my docker image starts with ros:foxy docker image. Maybe it's faulty in some sense

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant