libroscpp.so: cannot open shared object file: No such file or directory
I ran roscore
after setcap cap_net_admin,cap_net_raw+eip /usr/bin/python3.8
operation and below is the error I got. But the pyhton code below works properly.
opt/ros/noetic/lib/rosout/rosout: error while loading shared libraries: libroscpp.so: cannot open shared object file: No such file or directory process[rosout-1]: started with pid [10399] started core service [/rosout] [rosout-1] process has died [pid 10399, exit code 127, cmd /opt/ros/noetic/lib/rosout/rosout
__name:=rosout __log:=/home/bee/.ros/log/430043e8-0177-11ee-b48f-df7e4d4418d2/rosout-1.log]. log file: /home/bee/.ros/log/430043e8-0177-11ee-b48f-df7e4d4418d2/rosout-1*.log [rosout-1] restarting process
After running the setcap -r /usr/bin/python3
process, roscore
works fine, but the python code below does not work properly, giving an authorization error.
import pysoem
def test_pysoem():
master = pysoem.Master()
result = master.open("enp1s0")
master.close()
Error (without setuid privileges in python3.8):
$ python3.8 pysoem_test.py
> Traceback (most recent call last):
> File "ethercat_test.py", line 19, in
> <module>
> master.open('enp1s0') File "pysoem/pysoem.pyx", line 201, in pysoem.pysoem.CdefMaster.open
> ConnectionError: could not open interface enp1s0
I am using ubuntu 20.04.6 and ros noetic. I've run it this way with the melodic before.
$printenv | grep ROS
ROS_VERSION=1
ROS_PYTHON_VERSION=3
ROS_PACKAGE_PATH=/opt/ros/noetic/share
ROSLISP_PACKAGE_DIRECTORIES=
ROS_ETC_DIR=/opt/ros/noetic/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_ROOT=/opt/ros/noetic/share/ros
ROS_DISTRO=noetic
$ echo $LD_LIBRARY_PATH
/home/bee/catkin_ws/devel/lib:/opt/ros/noetic/lib
Why does roscore give an error when giving setuid permissions to python3.8?
If your library does not work outside of ros, then you'll need to resolve that issue first. After removing the suid change, have you tried:
If it doesn't work, your code is probably wrong. Frankly, when I look at the description for this pysoem library, it does not look like a function that belongs inside a ros node.