ModuleNotFoundError: No module named ‘***‘

在用 Python 编写程序后,如果在运行时报错如下,说明该模块还未安装,需要进行安装。

比如报错如下:

ModuleNotFoundError: No module named ‘reportlab’

其中,reportlab 是一个处理 PDF 和画图的 python 开源库,安装时通过 pip 工具直接安装即可,比如 Windows 系统下安装如图所示:

安装后,查看是否安装成功,命令如下:

pip list

 

另外,一些安装和卸载的常见命令如下:

首次安装模块:

pip install reportlab

覆盖安装模块:

pip install --upgrade --force-reinstall reportlab

卸载模块:

pip uninstall reportlab

原文链接:https://blog.csdn.net/tzhuwb/article/details/108307909

此条目发表在Python分类目录,贴了, , , , , , 标签。将固定链接加入收藏夹。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注