ModuleNotFoundError: No module named 'sphinx.setup_command'

asked 2023-07-18 11:06:33 -0500

jfr560 gravatar image


  • Ubuntu 20.04
  • ROS2 Foxy
  • setuptools 68.0.0

I recently installed ROS2 Foxy on my computer. The installation finished successfully and tested ROS by running the talker demo and it worked fine. However, when I tried compiling a new package that I created with the example publisher from the documentation, I get a compilation error "no module name sphinx.setup_command". I installed sphinx by running sudo apt-get install python3-sphinx and I am still getting this error. I assume the issue related to setuptools. Any idea why I am getting this error ?

I couldn't upload a picture so I copied the output.

Summary: 0 packages finished [0.92s]

1 package failed: my_package

1 package had stderr output: my_package

Expected ['/usr/bin/python3', '', '--help-commands'] to pass: Traceback (most recent call last):

File "", line 5, in <module>

setup( File "/home/joahn/.local/lib/python3.8/site-packages/setuptools/", line 107, in setup

return distutils.core.setup(**attrs)

File "/home/joahn/.local/lib/python3.8/site-packages/setuptools/_distutils/", line 172, in setup

ok = dist.parse_command_line()

File "/home/joahn/.local/lib/python3.8/site-packages/setuptools/_distutils/", line 472, in parse_command_line

if self.handle_display_options(option_order):

File "/home/joahn/.local/lib/python3.8/site-packages/setuptools/", line 1210, in handle_display_options

return _Distribution.handle_display_options(self, option_order)

File "/home/joahn/.local/lib/python3.8/site-packages/setuptools/_distutils/", line 686, in handle_display_options


File "/home/joahn/.local/lib/python3.8/site-packages/setuptools/", line 987, in print_commands

cmdclass = ep.load()

File "/home/joahn/.local/lib/python3.8/site-packages/setuptools/_vendor/importlib_metadata/", line 208, in load

module = import_module('module'))

File "/usr/lib/python3.8/importlib/", line 127, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap="">", line 1014, in _gcd_import

File "<frozen importlib._bootstrap="">", line 991, in _find_and_load

File "<frozen importlib._bootstrap="">", line 973, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'sphinx.setup_command'

edit retag flag offensive close merge delete