ros-infrastructure/catkin_pkg

Version conflict with 1.0.0

tonybaltovski opened this issue · 2 comments

After updating to 1.0.0, running catkin_generate_changelog --skip-merges fails with:

/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 3.0.1-master is an invalid version and will not be supported in a future release
  warnings.warn(
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 573, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 782, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (catkin-pkg 1.0.0 (/usr/lib/python3/dist-packages), Requirement.parse('catkin-pkg==0.5.2'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/catkin_generate_changelog", line 33, in <module>
    sys.exit(load_entry_point('catkin-pkg==0.5.2', 'console_scripts', 'catkin_generate_changelog')())
  File "/usr/local/bin/catkin_generate_changelog", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/catkin_pkg/cli/generate_changelog.py", line 10, in <module>
    from catkin_pkg.changelog import CHANGELOG_FILENAME
  File "/usr/lib/python3/dist-packages/catkin_pkg/changelog.py", line 53, in <module>
    import pkg_resources
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3267, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3241, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3279, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 575, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'catkin-pkg==0.5.2' distribution was not found and is required by the application

Had the following installed:

Package: python3-catkin-pkg
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 26
Maintainer: Dirk Thomas <dthomas@osrfoundation.org>
Architecture: all
Version: 1.0.0-100
Depends: python3:any (>= 3.6~), python3-catkin-pkg-modules (>= 1.0.0), python3-dateutil, python3-docutils
Conflicts: catkin, python-catkin-pkg
Description: catkin package library
 Library for retrieving information about catkin packages.
Homepage: http://wiki.ros.org/catkin_pkg
Package: python3-catkin-pkg-modules
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 252
Maintainer: Dirk Thomas <dthomas@osrfoundation.org>
Architecture: all
Version: 1.0.0-1
Replaces: python3-catkin-pkg (<< 0.3.0)
Depends: python3:any (>= 3.6~), python3-dateutil, python3-docutils, python3-pyparsing
Conflicts: catkin, python3-catkin-pkg (<< 0.3.0)
Description: catkin package library
 Library for retrieving information about catkin packages.
Homepage: http://wiki.ros.org/catkin_pkg

Any thoughts on how to fix ths?

The traceback shows that the top-level executable is /usr/local/bin/catkin_generate_changelog, which isn't the one distributed by the debs. I'm guessing that there was once a pip package installed which wasn't touched when the deb got updated. It worked before only because the pip package and the deb were the exact same version.

$ dpkg -L python3-catkin-pkg | grep bin/
/usr/bin/catkin_create_pkg
/usr/bin/catkin_find_pkg
/usr/bin/catkin_generate_changelog
/usr/bin/catkin_package_version
/usr/bin/catkin_prepare_release
/usr/bin/catkin_tag_changelog
/usr/bin/catkin_test_changelog

You should remove the catkin_pkg executables from /usr/local/bin/, which should make your system use the ones in /usr/bin/ instead.

Thanks! Removing those fixed it.