【问题标题】:how to recompile the bootloader of Pyinstaller如何重新编译 Pyinstaller 的引导加载程序
【发布时间】:2019-05-04 04:40:22
【问题描述】:

我有一个使用 PyInstaller 生成的 exe 文件的防病毒误报问题,通过搜索我找到了 this 答案女巫包括重新编译引导加载程序,但我无法完成它。 这是我迄今为止尝试过的:

  1. 尝试使用“choco install -y vcbuildtools”安装带有 choco 的 C++ 构建工具,但由于某些原因安装失败。
  2. here 安装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 上

【问题讨论】:

  • 你有没有成功重新编译过pyinstaller的bootloader?
  • 很遗憾,没有:(

标签: python pyinstaller antivirus virus false-positive


【解决方案1】:

对于任何收到错误“无法配置 C 编译器!”的人!

只需在您的机器上安装一个 C 编译器。

我安装了带有 C++ 编译器的 Visual Studio,因为它更简单、更合法。

https://visualstudio.microsoft.com/vs/features/cplusplus/

【讨论】:

    【解决方案2】:

    如果您使用pip install …,则不会安装引导加载程序源。您需要使用 PyInstaller 的源代码包(git clone 或从 github 下载存档)。

    GitHub - Bootloader Issue

    PyInstaller GitHub

    【讨论】:

      【解决方案3】:

      嘿,你不需要 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”来创建你的可执行文件。

      希望这有帮助!

      【讨论】:

      • 我的问题是当我执行“python3 ./waf distclean all”时出现此错误:python: can't open file './waf': [Errno 2] No such file or directory
      • 那你肯定不在正确的目录下,运行pwd看看你在哪里。它应该是 .../pyinstaller/bootloader
      • 同样使用ls列出所有文件,你所在的目录下应该有一个名为waf的文件...
      • 这确实对我有用。对于第 3 步,确保您在 pyinstaller-3.5/bootloader 目录中运行“python ./waf distclean all”,然后对于第 4 步,确保您 cd .. 回到 pyinstaller-3.5 文件夹并运行“python setup.py在 setup.py 文件中安装”。第一次完美运行。
      • 答案也对我有用。 python ./waf distclean all 命令使用我电脑中的 VS2019 编译器编译和构建 `~\pyInstaller-3.6\bootloader\Windows-64bit` 目录下的所有run*.exe 文件。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-28
      • 1970-01-01
      • 1970-01-01
      • 2019-08-03
      • 2019-11-08
      • 2015-02-24
      相关资源
      最近更新 更多