ROS报No module named ‘Cryptodome’

错误日志
python3使用ROS的cv_bridge包时,报:

ModuleNotFoundError: No module named 'Cryptodome'
# 或者
ModuleNotFoundError: No module named 'gnupg'

解决方法
pip安装上面的包就行了

pip install pycryptodomex gnupg

sphinx指定使用python3进行doc编译

使用sphinx为python工程编译API文档时,Makefile默认采用python2的环境编译,如下面的Makefile所示:

# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS    ?= -j 4
SPHINXBUILD   ?= sphinx-build
SOURCEDIR     = source
BUILDDIR      = build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

show:
	open $(BUILDDIR)/html/index.html

如果要使用python3编译,则首先安装python3版本的sphinx:

sudo -H pip3 install -U sphinx
# 或者在conda环境下
pip install sphinx

然后修改上面Makefile中的:

# 替换
SPHINXBUILD   ?= sphinx-build
# 为
SPHINXBUILD   = python3 -msphinx

然后在sphinx-build就行了。

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐