简体   繁体   English

Pyinstaller “没有名为 xlsxwriter 的模块”

[英]Pyinstaller “No module named xlsxwriter”

When I used pyinstaller to package my program using the command pyinstaller --onefile main.py --hidden-import jaraco.windows.api.memory , and the.exe generates just fine. When I used pyinstaller to package my program using the command pyinstaller --onefile main.py --hidden-import jaraco.windows.api.memory , and the.exe generates just fine. However, when I try to launch it, it crashes immediately with an error message that says ImportError: No module named xlsxwriter .但是,当我尝试启动它时,它会立即崩溃,并显示一条错误消息ImportError: No module named xlsxwriter

I saw a previous thread on here where someone had a similar error, however in that thread, the solution was to import it in the script, but I have already done that.我在这里看到了一个以前的线程,其中有人遇到了类似的错误,但是在那个线程中,解决方案是在脚本中导入它,但我已经这样做了。 On the first line.在第一行。

The general structure of my program is as follows: There is a homemade utils library, where some of the items import xlsxWriter.我的程序的大体结构如下:有一个自制的utils库,其中一些项目导入xlsxWriter。 The main method imports each file in the library main 方法导入库中的每个文件

Add --hidden-import xlsxwriter to your build command.将 --hidden-import xlsxwriter 添加到您的构建命令中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM