import numpy error in geometry_msg in setting-robot simulation tutorial
When I was trying the tutorial setting-up a robot simulation setting-up a robot simulation and I encountered an error that I'm not being sure on how to solve since it seems that it is unable to find numpy in the site-packages of the python inside the ros/foxy installation. The error that I find is:
[driver-2] Traceback (most recent call last):
[driver-2] File "/home/pablo/dev_ws/install/my_package/lib/python3.8/site-packages/my_package/my_robot_driver.py", line 2, in <module>
[driver-2] from geometry_msgs.msg import Twist
[driver-2] File "/opt/ros/foxy/lib/python3.8/site-packages/geometry_msgs/msg/__init__.py", line 3, in <module>
[driver-2] from geometry_msgs.msg._accel_with_covariance import AccelWithCovariance # noqa: F401
[driver-2] File "/opt/ros/foxy/lib/python3.8/site-packages/geometry_msgs/msg/_accel_with_covariance.py", line 9, in <module>
[driver-2] import numpy # noqa: E402, I100
[driver-2] ModuleNotFoundError: No module named 'numpy'
[driver-2] terminate called after throwing an instance of 'std::runtime_error'
[driver-2] what(): The my_package.my_robot_driver.MyRobotDriver plugin cannot be found (C++ or Python).
I have seen this error before with Webots: Try
pip3 install numpy
. Let me know if it works, then I will document as an answer.Sorry shouldn’t be recommending
pip3
, try this first:sudo apt install python3-numpy
@pablo.arandarod did you try?
@osilva yes, and also having it installed in other environments and did not worked. I reinstalled ros foxy, so once I have time again I will go into it (hopefully this weekend)
@osilva I just tried it and I can confirm that by installing ros thorugh apt the tutorial works. I don't know if there is some dependency or anything that isn't working as it should when I built it, but at least it works if I install it.
Thank you @pablo.arandarod. Let me document as an answer
@osilva I don't know exactly how to do it from here, I'm a bit new to this.
Hi @pablo.arandarod, if you arrive to a solution, it's good practice to document by summarizing the problem encountered and the resolution in the form of an answer. You can respond to your own questions as well. To accept the answer, please click on the checkmark and vote up if the advice was helpful to increase karma. Increasing karma motivates answerers to continue helping, so it's good practice.