3

I was trying to follow this tutorial in the official documentation of ros2 Humble for Integrating launch files into ROS 2 packages and ran in to the below given error after doing trying to perform a build on the package using

colcon build --packages-select py_launch_example 

The package build compilation given me the following error.

Starting >>> py_launch_example
[3.759s] WARNING:colcon.colcon_ros.task.ament_python.build:Package 'py_launch_example' doesn't explicitly install a marker in the package index (colcon-ros currently does it implicitly but that fallback will be removed in the future)
[3.793s] WARNING:colcon.colcon_ros.task.ament_python.build:Package 'py_launch_example' doesn't explicitly install the 'package.xml' file (colcon-ros currently does it implicitly but that fallback will be removed in the future)
--- stderr: py_launch_example                   
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< py_launch_example [1.23s]

Summary: 1 package finished [4.38s] 1 package had stderr output: py_launch_example

I have found a similar issue in this thread in ROS Answers. Please help! Thank you

Additional Informations

  • operating system : Ubuntu 22.04 LTS
  • ROS Distro : Humble
  • Python version : 3.10.6

Solutions I have tried :

  1. Downgrading the setuptools to older version 58.2.0, this actually worked for me and the warning was no longer shown.
  2. removing the line install_requires=['setuptools'] from the setup.py file and use --allow-overriding tag while rebuilding. This solution didn't work for me.
Jishnu
  • 191
  • 1
  • 12
  • What solution did you try to use? And why wasn't it permanent? – Tully Dec 28 '22 at 22:20
  • Also note that this is a warning and not an error. You can continue to use it with these errors, it will become an error in the future when the depreciated capability is removed. – Tully Dec 28 '22 at 22:22
  • If we wanted to get started now fixing this before it becomes an error, what would we do? Maybe there is a package that made the required changes and the corresponding PR is a good example to follow presumably in every package that shows the warning? Or is it a matter of modifying/refactoring colcon itself? – Lucas Walter Dec 29 '22 at 23:16
  • @Tully, I have tried solutions mentioned here. First I downgraded the setup-tools package to a lower version, it worked for me, the warning went off and was able to proceed with launching the program. I have also tried removing the install_requires=['setuptools'] provided in third solution in the same link, but it didn't work. I mentioned this solution is not permanent because it involved downgrading a python package which is not recommended – Jishnu Jan 01 '23 at 16:12
  • These are all important parts of your question. You should edit it to include this important information. And when you do, you should update your description to reflect that it did actually work, and it is permanent. But you would rather a different way and what your specific constraints are that aren't met by the existing answers, aka you don't want to downgrade. But know that if you ask for too many constraints it may not be something achievable. Aka the answer from @Dave is going to be your best advice. Deprecation cycles are non-zero length for a reason while new solutions are implemented. – Tully Jan 03 '23 at 07:22
  • Hi, I've encountered the same error with the python 3.10.12.

    However, now it's not and warning it is an error. What can I do?

    – Filip Zorić Nov 28 '23 at 13:41

4 Answers4

5

I'm pretty familiar with this issue, and we're not quite ready to move to the new APIs that the setuptools folks are deprecating the current workflows in favor of. This post has a robust, if somewhat outdated, summary of some of the hurdles: https://github.com/colcon/colcon-core/issues/454#issuecomment-1262592774

As an alternative to downgrading setuptools, you could use the PYTHONWARNINGS environment variable to suppress that particular warning. I added this to my .bashrc and it works well:

PYTHONWARNINGS="ignore:setup.py install is deprecated::setuptools.command.install"; export PYTHONWARNINGS
cottsay
  • 106
  • 1
  • 1
2

It is a warning message, which affects Humble. The problem is the newest version of setuptools. Look here for a possible solution. Basically you should downgrade setuptools to 58.2.0. Personally I leave setuptools to the last version. Since this is a warning and not an error, it is annoying but not a problem. Probably it is going to disappear after the next update of setuptools. Downgrade is never a good option (to me)

Wilhelm
  • 700
  • 6
  • 16
  • Thanks for the reply actually, I have referred the same link for the answer and never got a satisfactory answer :( – Jishnu Jan 01 '23 at 16:14
  • 1
    I know, satisfactory is not. I have the same issue and prefer to keep that warning instead of downgrading my system. I downgraded it once (another package) and the result was that I destroy completely all the rest of my environment. After that experience, I won't downgrade anymore – Wilhelm Jan 01 '23 at 21:27
0

I had two warnings:

~/.local/lib/python3.10/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
~/.local/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.

Following cottsay's solution, I added the following to my ~/.bashrc to hide the problem:

PYTHONWARNINGS="ignore:easy_install command is deprecated,ignore:setup.py install is deprecated"
export PYTHONWARNINGS
tropappar
  • 1
  • 1
0

I've encountered same problem, however I'm not able to downgrade setuptools.

Also, I'm not getting warning, I'm getting error output.

This is the output of my python3 launch command:

python3
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux

And I'm using setuptools 59.6.0.

Output of the command:

colcon build --symlink-install --packages-select urdf_tutorial_r2d2

is:

 urdf_tutorial_r2d2
--- stderr: urdf_tutorial_r2d2                   
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(

Do you have any suggestions. Thanks! :)

UPDATE

Managed to downgrade my setuptools to 58.2.0. By running following commands:

sudo apt-get update
sudo apt-get install python3-pip 
pip install setuptools==58.2.0 

But I'm wondering is there any elegant solution, or downgrade of the setuptools should be incorporated in the environment setup?

Thanks!