Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(yiye) zp@zp-ros:~/catkin_ws$ rosrun motion_planing test.py Traceback (most recent call last): File "/home/zp/catkin_ws/devel/lib/motion_planing/test.py", line 15, in <module> exec(compile(fh.read(), python_script, 'exec'), context) File "/home/zp/catkin_ws/src/motion_planing/scripts/test.py", line 2, in <module> import urx ModuleNotFoundError: No module named 'urx' #127

Open
zp2546265641 opened this issue May 16, 2024 · 0 comments

Comments

@zp2546265641
Copy link

i just try to use urx to control ur real robor, but when i import, "no mudule urx"problem happened.and even when i add "export PYTHONPATH=$PYTHONPATH:/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/" to point the package road, it tells me below.
my code:
#! /home/zp/anaconda3/envs/yiye/bin/python
import urx
import logging

if name == "main":
try:
logging.basicConfig(level=logging.INFO)
robot = urx.Robot("192.168.0.10")
end_effector_pose = robot.getl()
print("末端位姿:", end_effector_pose)
finally:
robot.close()
error_message:
Traceback (most recent call last):
File "/home/zp/catkin_ws/devel/lib/motion_planing/test.py", line 15, in
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/zp/catkin_ws/src/motion_planing/scripts/test.py", line 2, in
import urx
ModuleNotFoundError: No module named 'urx'
(yiye) zp@zp-ros:/catkin_ws$ export PYTHONPATH=$PYTHONPATH:/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/
(yiye) zp@zp-ros:
/catkin_ws$ rosrun motion_planing test.py
Traceback (most recent call last):
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/numpy/core/init.py", line 24, in
from . import multiarray
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/numpy/core/multiarray.py", line 10, in
from . import overrides
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/numpy/core/overrides.py", line 8, in
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/numpy/init.py", line 130, in
from numpy.config import show as show_config
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/numpy/config.py", line 4, in
from numpy.core._multiarray_umath import (
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/numpy/core/init.py", line 50, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  • The Python version is: Python3.8 from "/usr/bin/python3"
  • The NumPy version is: "1.26.4"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/zp/catkin_ws/devel/lib/motion_planing/test.py", line 15, in
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/zp/catkin_ws/src/motion_planing/scripts/test.py", line 2, in
import urx
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/urx/init.py", line 4, in
from urx.urrobot import RobotException, URRobot # noqa
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/urx/urrobot.py", line 9, in
from urx import urrtmon
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/urx/urrtmon.py", line 14, in
import numpy as np
File "/home/zp/anaconda3/envs/yiye/lib/python3.9/site-packages/numpy/init.py", line 135, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant