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就行了。