pietrolechthaler / UR5-Pick-and-Place-Simulation

Simulate the iteration of a UR5 robot with Lego bricks
https://youtu.be/v45mPw_XEXA
MIT License
107 stars 25 forks source link

pyquaternion exists but can not be found. #11

Open xjtu19 opened 6 months ago

xjtu19 commented 6 months ago

Everything seems ok until I run rosrun motion_planning motion_planning.py. The error is as follows:

(tamp) xj@xj:~$ rosrun motion_planning motion_planning.py Traceback (most recent call last): File "/home/xj/catkin_ws/src/motion_planning/scripts/motion_planning.py", line 9, in from controller import ArmController File "/home/xj/catkin_ws/src/motion_planning/scripts/controller.py", line 8, in from pyquaternion import Quaternion ModuleNotFoundError: No module named 'pyquaternion

Then I install the unfound package, but actually it's already installed:

(tamp) xj@xj:~$ pip install pyquaternion Requirement already satisfied: pyquaternion in ./anaconda3/envs/tamp/lib/python3.9/site-packages (0.9.9) Requirement already satisfied: numpy in ./anaconda3/envs/tamp/lib/python3.9/site-packages (from pyquaternion) (1.26.4)

I also test it in python, this package can be imported.

(tamp) xj@xj:~$ python Python 3.9.19 (main, Mar 21 2024, 17:11:28) [GCC 11.2.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. import pyquaternion from pyquaternion import Quaternion

Now I'm confused about why this happen and how to solve it. Thank you very much.

xjtu19 commented 6 months ago

It's python version error. The default python version for ubuntu 20.04 is python3.8 in the /usr/bin/python3.8. Install pyquaternion and it works!