Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

ImportError: dynamic module does not define module export function

# NOTES: ROS Melodic -- Python3.7
# Solution is to build cv_bridge with python3.
sudo apt-get install python-catkin-tools python3-dev python3-catkin-pkg-modules python3-numpy python3-yaml ros-melodic-cv-bridge

# Create catkin workspace
mkdir catkin_workspace
cd catkin_workspace
catkin init

# Instruct catkin to set cmake variables
catkin config -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so
# Instruct catkin to install built packages into install place. It is $CATKIN_WORKSPACE/install folder
catkin config --install

# Clone cv_bridge src
git clone https://github.com/ros-perception/vision_opencv.git src/vision_opencv
# Find version of cv_bridge in your repository
apt-cache show ros-melodic-cv-bridge | grep Version
    Version: 1.13-0******

# Checkout right version in git repo. In our case it is 1.13.0
cd src/vision_opencv/
git checkout 1.13.0
cd ../../
# Build
catkin build cv_bridge
# Extend environment with new package
source install/setup.bash --extend

# And you can test it with the following 
$ python3
Python 3.7.5 (default, Feb 23 2021, 13:22:40) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cv_bridge.boost.cv_bridge_boost import getCvType
>>> 

# Or add it to your bashrc file
source ~/catkin_workspace/install/setup.bash --extend
Comment

PREVIOUS NEXT
Code Example
Python :: library for converting text into image in python 
Python :: python efficiently find duplicates in list 
Python :: discord.py read embed on message 
Python :: date.month date time 
Python :: pandas filter with given value 
Python :: user input python 
Python :: count dictionary keys 
Python :: # How to Prints the current working directory in python 
Python :: radix sort in python 
Python :: how to use pafy 
Python :: python print odd numberrs 
Python :: Python program to draw star 
Python :: copy website 
Python :: python dictionary rename key 
Python :: df .sort_values 
Python :: python scraping 
Python :: ssl django nginx 
Python :: python how to remove commas from string 
Python :: progressbar time in python 
Python :: python how to make notepad 
Python :: apply lambda with if 
Python :: pandas data profiling 
Python :: root mean square python 
Python :: import get_object_or_404 
Python :: tabula python 
Python :: how to remove a tuple from a list python 
Python :: selenium if statement python 
Python :: how to get scrapy output file in csv 
Python :: python map string to int 
Python :: convert list to numpy array 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =