您当前的位置: 首页 >  Python

RuiH.AI

暂无认证

  • 0浏览

    0关注

    274博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

ROS报错:No module named ‘Cryptodome‘, sphinx指定使用python3编译

RuiH.AI 发布时间:2022-07-21 15:11:29 ,浏览量:0

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

关注
打赏
1658651101
查看更多评论
立即登录/注册

微信扫码登录

0.0417s