简体   繁体   English

PyInstaller-隐藏导入通配符?

[英]PyInstaller --hidden-import wildcard?

I'm trying to make executable from Scrapy project. 我正在尝试从Scrapy项目中使可执行文件。 I've noticed that I have to say PyInstaller what scrapy modules it has to load. 我注意到我不得不说PyInstaller它必须加载哪些刮板模块。 The problem is that there is a lot of these modules. 问题是这些模块很多。

pyinstaller --onefile main.py --hidden-import scrapy.spiderloader --hidden-import scrapy.statscollectors --hidden-import scrapy.....

Is it possible to set PyInstaller to preimport all modules? 是否可以将PyInstaller设置为预导入所有模块? Something like --hidden-import scrapy.* which doesn't work. --hidden-import scrapy.*类的东西不起作用。

Pyinstaller should have created a "main.spec" file. Pyinstaller应该已经创建了一个“ main.spec”文件。 In that file, there is a line containing "hiddenimports=[]". 在该文件中,一行包含“ hiddenimports = []”。 That is where you can list all the hidden imports and only do it once. 在这里,您可以列出所有隐藏的导入,并且只执行一次。 You may be able to use wildcards in that list, but I'm not sure of that. 您也许可以在该列表中使用通配符,但是我不确定。

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

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