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

import distutils.command.bdist_wininst as orig

asked 2023-01-23 11:10:14 -0600

ma ar gravatar image

Everything went well while I was trying to create a ros 2 package in Ubuntu 22.04 by following the ros2 documentation, however when I got to the colcon build step, it failed for python packages even though it works for cMake packages.

colcon build --packages-select mypkgpython
...
import distutils.command.bdist_wininst as orig
ModuleNotFoundError: No module named 'distutils.command.bdist_wininst'

knowing that my python version is:

python3 --version
Python 3.10.6

i have tried: sudo apt-get install python3-distutils:

python3-distutils is already the newest version (3.10.6-1~22.04).

sudo apt-get install python3-apt:

python3-apt is already the newest version (2.4.0).

sudo apt install python3-colcon-common-extensions

python3-colcon-common-extensions is already the newest version(0.3.0-1)

how can i solve this problem?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-01-31 15:51:09 -0600

ma ar gravatar image

The bdist_wininst format was deprecated in Python 3.8, and the documentation for this format has been removed in Python 3.9. The recommended way to distribute Python packages now is the Wheel format.

you can overcome this error by JUST updating the setuptools

pip install --upgrade setuptools

Note that: Setuptools version 58.2.0 is the last version that works with ROS 2 python packages without any warnings because it is the last version that supports the old installation method, "python setup.py install." This method has been deprecated and replaced by newer, standards-based tools, such as pip and ament.

pip install setuptools==58.2.0
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-01-23 11:10:14 -0600

Seen: 129 times

Last updated: Jan 31 '23