how to install cvbridge (python version)?
hello,when I run code ,occur such error
ubuntu 1804, ros-melodic
Traceback (most recent call last):
File "/home/lzw/resplendent_code/voxblox_pp_ws/src/mask_rcnn_ros/scripts/mask_rcnn_node.py", line 9, in <module>
from cv_bridge import CvBridge
ImportError: No module named cv_bridge
and if I execute this command sudo -H pip3 install cv_bridge
i get
Collecting cv_bridge
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/cv-bridge/
Hi @resplendent star,
Why not install the dependency from the precompiled binaries with apt?
hi,i have already use this command to install cvbridge,but still will get the error that i post above
if i use sudo apt-get install i will get
lzw@resplendent-star:~/3d_lib/pycharm-2019.3.3/bin$ sudo apt-get install ros-$(rosversion -d)-cv-bridge [sudo] lzw 's password: 正在读取软件包列表... done 正在分析软件包的依赖关系树
正在读取状态信息... done
ros-melodic-cv-bridge is the latest version(1.13.0-0bionic.20200320.133849)。
Mmm, probably the issue is that
cv_bridge
is built only for python 2.7 and you are using python 3 interpreter, that is the default for ROS Melodic. Since the interpreter is trying to usecv_bridge
for 2.7 will always fails for Python 3.To solve it you can try to install:
and then create a new
catkin_ws
configured to use your Python 3.XX version. That can be done by:Please note this assumes a Python 3.6 version.
thanks for reply,how to install cvbridge with conda?:)
Well, as you may notice, this forum is for ROS problems and issues, unfortunatelly you question is out of the scope of the forum so you probably want to ask it in a more suitable place. However, just perform a quick search and you will end in wiki pages like this.