Closed s-sarahSM closed 2 years ago
How to run python3 files with ros melodic as Ros melodic is purely based on python2.7.
I get this error while running "roslaunch yolov4_trt_ros yolov4_trt.launch", here is the error
Traceback (most recent call last): File "/home/catkin_ws/src/yolov4_trt_ros/trt_yolo_v4.py", line 6, in import cv2 File "/usr/lib/python3.6/dist-packages/cv2/init.py", line 89, in bootstrap() File "/usr/lib/python3.6/dist-packages/cv2/init.py", line 62, in bootstrap ], True) File "/usr/lib/python3.6/dist-packages/cv2/init.py", line 56, in load_first_config raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames)) ImportError: OpenCV loader: missing configuration file: ['config-2.7.py', 'config-2.py']. Check OpenCV installation. [yolov4_trt_node-1] process has died [pid 11630, exit code 1, cmd /home/catkin_ws/src/yolov4_trt_ros/trt_yolo_v4.py name:=yolov4_trt_node log:=/home/.ros/log/a39fb3ce-626c-11ec-a693-eae4f550af8b/yolov4_trt_node-1.log]. log file: /home/.ros/log/a39fb3ce-626c-11ec-a693-eae4f550af8b/yolov4_trt_node-1*.log
For python3, you need to run it with python3 command - python3 node_name. Do let me know if that works!
python3 node_name
How to run python3 files with ros melodic as Ros melodic is purely based on python2.7.
I get this error while running "roslaunch yolov4_trt_ros yolov4_trt.launch", here is the error
Traceback (most recent call last): File "/home/catkin_ws/src/yolov4_trt_ros/trt_yolo_v4.py", line 6, in
import cv2
File "/usr/lib/python3.6/dist-packages/cv2/init.py", line 89, in
bootstrap()
File "/usr/lib/python3.6/dist-packages/cv2/init.py", line 62, in bootstrap
], True)
File "/usr/lib/python3.6/dist-packages/cv2/init.py", line 56, in load_first_config
raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
ImportError: OpenCV loader: missing configuration file: ['config-2.7.py', 'config-2.py']. Check OpenCV installation.
[yolov4_trt_node-1] process has died [pid 11630, exit code 1, cmd /home/catkin_ws/src/yolov4_trt_ros/trt_yolo_v4.py name:=yolov4_trt_node log:=/home/.ros/log/a39fb3ce-626c-11ec-a693-eae4f550af8b/yolov4_trt_node-1.log].
log file: /home/.ros/log/a39fb3ce-626c-11ec-a693-eae4f550af8b/yolov4_trt_node-1*.log