首页 > 解决方案 > 没有模块名称'configparser' | PyInstaller

问题描述

我已使用 pyinstaller 将我的 .py 文件转换为 .exe

pyinstaller newpass.py

它使exe文件成功!但是当我打开文件时,它显示了这个错误:

在此处输入图像描述

错误来自文件“encdec.py”第 1 行,但我在该文件中的代码如下。

from passlib.context import CryptContext
from cryptography.fernet import Fernet

(当我运行我的主要 python 文件时,我的程序完美运行!)

一旦我打开文件,它就会显示此错误并且程序关闭。

注意:-我没有在任何文件中导入“配置解析器”。

我的文件结构如下:-

在此处输入图像描述

在这里,newpass.py 是我希望转换为 exe 的主文件

标签: pythonpyinstaller

解决方案


尝试执行pip install configparsorpip3 install configparsor取决于您的 python 版本。


推荐阅读