Unsupported interface type {interface_file.suffix}
A bunch of us hit this after doing an apt upgrade these last couple days:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "/opt/ros/rolling/lib/python3.8/site-packages/rosidl_adapter/__init__.py", line 32
assert False, f"Unsupported interface type '{interface_file.suffix}'"
I found that by purging python-is-python2
I could get the problem to go away. This also uninstalls a couple other packages from the ros ecosystem:
Commandline: apt purge python-is-python2
Requested-By: tyler (1000)
Purge: python-is-python2:amd64 (2.7.17-4), python-vcstools:amd64 (0.1.42-1), python-dev-is-python2:amd64 (2.7.17-4), python-wstool:amd64 (0.1.17-1)
End-Date: 2021-11-06 18:44:43
I recognize that these are deprecated packages and that they were probably on my system for a long time and not updated recently. This did seem to affect almost everyone in our office starting on Friday (Nov 5th).
Jochen found that this specific issue is fixed here: https://github.com/ros2/rosidl/pull/612 And that because that is not yet published you can hack around it with this:
sudo sed -i 's/PythonInterp/& 3/' /opt/ros/rolling/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake
The long term solution is that ROS 2 itself should probably use python3 directly instead of any dependence on the state of the symbolic link /usr/bin/python.
In the comments below it was pointed out that this is only possible if you upgraded to 20.04. If you upgraded to 20.04 it might be worth purging everything ros/python from your system to avoid issues like this. This issue is probably not as widespread as I thought it was because the number of people who upgraded from 18.04 is probably much higher on our team here than in the general population of ros. I'm sorry for making such an issue out of this. Thank you to those who looked into this.
It's not clear what question you are asking.
I'm here because I thought this belonged on github and I posted it there. But then a bunch of people on my team hit this so then I thought it was probably affecting a large number of people using ROS so I posted to discourse. Those that responded there asked me to post here, so here I am.
My question is two parts, what sort of standard should we have for calling python (and how can we go about making sure that standard is followed) so nothing is using the symlink /usr/bin/python as it is basically useless because of the
python-is-*
packages in Ubuntu?Thanks for moving the question here Tyler.
The packages
python-wstool
andpython-vcstools
are not published by Open Robotics for Ubuntu 20.04. In addition to both of those projects being deprecated and archived upstream, we do not publish any python 2 packages for Ubuntu Focal although we still provide the last releases of those projects as python3 packages.It's not clear to me how those packages got on your workstation. Was it previously running an earlier version of Ubuntu and then upgraded to 20.04?
@tylerjw I think it would help if the title was the actual error message, since that is what people tend to search for.
This machine was upgraded from 18.04. I would not be surprised if the other machines that people reported this issue from were also running 18.04. I was not able to reproduce this in any way in a 20.04 docker image.
@tylerjw: I'd suggest to post your last edit as an answer. That way we have a clear 'solution', and can mark this question as answered.