ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)

环境

Ubuntu 14.04 + ROS indigo + Anaconda | Python3.6.3

报错日志

cv_image = CvBridge().imgmsg_to_cv2(image_data, "bgr8")
File "/home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/vision_opencv/cv_bridge/python/cv_bridge/core.py", line 163, in imgmsg_to_cv2
dtype, n_channels = self.encoding_to_dtype_with_channels(img_msg.encoding)
File "/home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/vision_opencv/cv_bridge/python/cv_bridge/core.py", line 99, in encoding_to_dtype_with_channels
return self.cvtype2_to_dtype_with_channels(self.encoding_to_cvtype2(encoding))
File "/home/zhw/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/vision_opencv/cv_bridge/python/cv_bridge/core.py", line 91, in encoding_to_cvtype2
from cv_bridge.boost.cv_bridge_boost import getCvType
ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)

解决方案

修改系统环境变量配置文件,vi ~/.bashrc,注释掉关于Anaconda的环境变量:

#export PATH=/home/soft/conda3/bin:$PATH

然后把这个环境变量改为PYTHON_PATH,如下:

export PYTHON_PATH=/home/soft/conda3/bin

你可能感兴趣的:(python,linux运维)