如何重新编译Pyinstaller的bootloader

inf*_*try 12 python antivirus virus pyinstaller false-positive

我有一个exe使用 PyInstaller 生成的文件的 AntiVirus 误报问题,通过搜索,我发现这个答案包含重新编译引导加载程序,但我无法完成。这是我到目前为止尝试过的:

  1. 由于某些原因安装失败,尝试使用“choco install -y vcbuildtools”安装带有choco的C++构建工具。
  2. 这里安装visual studio社区然后转到“cd bootloader”并python ./waf distclean all得到错误can't open file './waf': [Errno 2] No such file or directory
  3. 安装 MinGW-w64 并设置路径然后重试,我遇到了同样的错误。

或者也许有另一种方法可以使可执行文件不被检测为病毒/木马。

使用的软件包:PyQt5、pysnmp、pandas、numpy。

编辑: 感谢@Ana Knickerbocker 的回答,我能够取得进展,现在当我运行时python ./waf all出现错误: Python Version : 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] Checking for 'msvc' (C compiler) : not found Checking for 'gcc' (C compiler) : not found Checking for 'clang' (C compiler) : not found could not configure a C compiler!

我想我仍然没有编译器,我试过了,pip install vsbuildtools但我收到了这条消息:有No matching distribution found for vcbuildtools什么想法吗?

我在 Windows 7 x64

Abd*_*han 11

嘿你不需要visual studio来构建pyinstaller的引导程序,如果你安装了python或python3,你可以在你的终端中完成。重要的是要知道您使用的是哪一种。我假设你使用 python3,在你的终端/命令行中尝试以下步骤:

1) git clone https://github.com/pyinstaller/pyinstaller

2) cd pyinstaller,然后是 cd bootloader

3) 运行“python3 ./waf distclean all”为您的系统构建引导加载程序。

4) 构建引导加载程序后,输入:“python3 setup.py install”

5)这应该已经安装了pyinstaller。在终端中输入 pyinstaller 并按回车键。它应该识别命令,但它会抱怨更多的参数。

6) 使用命令“pyinstaller yourfile.py”创建可执行文件。

希望这有帮助!

  • 老实说,这对我有用。对于步骤 3,请确保您在 pyinstaller-3.5/bootloader 目录中运行“python ./waf distclean all”,然后对于步骤 4,请确保您 cd .. 回到 pyinstaller-3.5 文件夹并运行“python setup.py”安装”在 setup.py 文件中。第一次就完美地工作了。 (2认同)