ModuleNotFoundError: No module named camera_driver
Dear ROS-community, I am working on a ROS node which sends Image messages. For that I created a ROS package called "camera_driver" which contains the entry point named "entry" (see the setup.py):
import os
from glob import glob
from setuptools import find_packages
from setuptools import setup
package_name = "camera_driver"
setup(
name=package_name,
version="0.0.1",
packages=find_packages(exclude=["test"]),
data_files=[
(
"lib/python3.6/site-packages/src/resources/config",
glob("src/resources/config/*.json"),
),
(os.path.join("share", package_name), glob("launch/*.launch.py")),
(
"share/ament_index/resource_index/packages",
["resource/" + package_name],
),
("share/" + package_name, ["package.xml"]),
],
install_requires=["setuptools"],
zip_safe=True,
],
classifiers=[
"Intended Audience :: Developers",
"License :: No License",
"Programming Language :: Python",
],
license="No License",
tests_require=[],
entry_points={
"console_scripts": [
"driver_entry=camera_driver.entry:main"
],
},
)
However when I try to call ros2 pkg run camera_driver driver_entry I get the following error:
Traceback (most recent call last):
File "/home/dhbw/Documents/camera_ros/install/camera_driver/lib/camera_driver/driver_entry", line 33, in <module>
sys.exit(load_entry_point('camera-driver==0.0.1', 'console_scripts', 'driver_entry')())
File "/home/dhbw/Documents/camera_ros/install/camera_driver/lib/camera_driver/driver_entry", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/dhbw/.local/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 94, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'camera_driver'
I have already tried to add
#!/user/bin/env python3.6.9
to my driver_entry python script but without success. I am glad for any help.
Thank you in advance!