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

Cannot build package due to pkg_resources.extern.packaging.version.InvalidVersion

asked 2023-01-28 16:54:34 -0600

sdu568 gravatar image

Hello,

Currently, I am on Galactic, Ubuntu 20.4

Whenever I run colcon build, my process always fails and give the following reason. After doing some research, I know is having an issue about the pip version.

Thus, I am wondering if there is a way I can solve it. Thank you very much!

/home/shouyu/.local/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(

Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    setup(
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 108, in setup
    return distutils.core.setup(**attrs)
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/dist.py", line 1213, in run_command
    super().run_command(command)
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/command/develop.py", line 52, in finalize_options
    easy_install.finalize_options(self)
  File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 311, in finalize_options
    self.local_index = Environment(self.shadow_path + sys.path)
  File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1044, in __init__
    self.scan(search_path)
  File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1077, in scan
    self.add(dist)
  File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1096, in add
    dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
  File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2631, in hashcmp
    self.parsed_version,
  File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2685, in parsed_version
    raise packaging.version.InvalidVersion(f"{str(ex)} {info}") from None
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.23ubuntu1' (package: distro-info)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-01-29 11:39:59 -0600

sdu568 gravatar image

I solved the issue by downgrade by setuptools package in python to "65.7.0"

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-01-28 16:54:34 -0600

Seen: 931 times

Last updated: Jan 29 '23