No module named 'Cryptodomex' error when running rosmsg show
My system is ROS melodic / Ubuntu 18.04.
I tried to do rosmsg show [msg], but it returns this error:
dlee640@dlee640-ThinkPad-T580:~$ rosmsg show nav_msgs/Odometry
Traceback (most recent call last):
File "/opt/ros/melodic/bin/rosmsg", line 35, in <module>
rosmsg.rosmsgmain()
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosmsg/__init__.py", line 754, in rosmsgmain
sys.exit(rosmsg_cmd_show(ext, full, command))
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosmsg/__init__.py", line 582, in rosmsg_cmd_show
import rosbag
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/__init__.py", line 33, in <module>
from .bag import Bag, Compression, ROSBagException, ROSBagFormatException, ROSBagUnindexedException
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosbag/bag.py", line 53, in <module>
from Cryptodome.Cipher import AES
ModuleNotFoundError: No module named 'Cryptodome'
I have searched this issue and the recommended solution was to
pip install pycryptodomex
which returns
Requirement already satisfied: pycryptodomex in ./.pyenv/versions/3.8.6/lib/python3.8/site-packages (3.9.7)
Other than above, I have also tried
pip3 install pycryptodomex
pip3 install pycrypto
pip3 install Cryptodome
None of these seem to work. All the installation goes successful, but I think the problem is related to ROS not being able to locate the pycryptodomex property due to python version. I have tried normal pip instead of pip3 as well, so that is not the solution I am looking for.
Can someone guide me where to look for to address this issue?
Thank you.