最近在使用jaka机器人时候,每次打开终端都需要导入环境
Linux 需要将 libjakaAPI.so 和 jkrc.so 放在同一个文件夹下,并添加当前文件夹路径到环境变量,
(yolov8) rebot@wp:~/yolov8-yolo/ultralytics-main$ /home/rebot/anaconda3/envs/yolov8/bin/python /home/rebot/yolov8-yolo/ultralytics-main/y8-zed-xyz-jaka.py
Traceback (most recent call last):
File "/home/rebot/yolov8-yolo/ultralytics-main/y8-zed-xyz-jaka.py", line 13, in <module>
import jkrc
ImportError: libjakaAPI.so: cannot open shared object file: No such file or directory
在终端进行导入环境就可以了,=后面是 libjakaAPI.so 和 jkrc.so的存放文件夹
export LD_LIBRARY_PATH=/home/rebot/yolov8-yolo/ultralytics-main
但是每次启动终端都需要导入环境
如何在每次打开不进行导入环境就可以执行代码呢,网上搜索得到可用操作
1.打开注册表
sudo gedit ~/.bashrc
2.导入环境
export LD_LIBRARY_PATH=/home/rebot/yolov8-yolo/ultralytics-main
3.更新环境
source ~/.bashrc
心得,第一步长时间打不开,可以输入密码后,按ctrl+c打断后,继续输入就可以进入注册表了
rebot@wp:~$ sudo gedit ~/.bashrc
[sudo] rebot 的密码:
^C
rebot@wp:~$ sudo gedit ~/.bashrc
(gedit:15702): dconf-WARNING **: 10:52:25.502: failed to commit changes to dconf: 无法连接: 拒绝连接
(gedit:15702): dconf-WARNING **: 10:52:25.505: failed to commit changes to dconf: 无法连接: 拒绝连接
(gedit:15702): dconf-WARNING **: 10:52:25.602: failed to commit changes to dconf: 无法连接: 拒绝连接
(gedit:15702): dconf-WARNING **: 10:52:25.602: failed to commit changes to dconf: 无法连接: 拒绝连接
(gedit:15702): dconf-WARNING **: 10:52:25.602: failed to commit changes to dconf: 无法连接: 拒绝连接
导入环境 ,在打开的注册表末端输入后,保存关闭即可
标签:配置,yolo,连接,rebot,gedit,yolov8,Ubuntu,dconf,环境变量 From: https://blog.csdn.net/2301_78267730/article/details/144367898