Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
500 views
in Technique[技术] by (71.8m points)

python - how to recompile the bootloader of Pyinstaller

I have an AntiVirus false positive problem of my exe file generated using PyInstaller, by searching i found this answer witch consist of recompiling the bootloader and i just can't get it done. This what i've tried so far:

  1. try to install C++ build-tools with choco using "choco install -y vcbuildtools" for some reasons the installation failed.
  2. installing visual studio community from here then goes to "cd bootloader" and do python ./waf distclean all got the error can't open file './waf': [Errno 2] No such file or directory
  3. installing MinGW-w64 and setting the path then retry, i got the same error.

Or maybe there is another way to make the executable not detected as virus/trojan.

Packages used : PyQt5, pysnmp, pandas, numpy.

EDIT: Thanks to @Ana Knickerbocker answer i was able to make a progression, now when i run python ./waf all i got the error : 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!

I guess i still don't have a compiler, i've tried pip install vsbuildtoolsbut i got this message : No matching distribution found for vcbuildtools any ideas ?

Im on Windows 7 x64

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Hey you don't need visual studio to build pyinstaller's bootloader, you can do it in your terminal if you have python or python3 installed. It's important to know which one you are using. I will assume you use python3, try the following steps in your terminal/command line:

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

2) cd pyinstaller, then cd bootloader

3) Run “python3 ./waf distclean all” to build the bootloader for your system.

4) Once the bootloader has been built, type in: “python3 setup.py install”

5) This should have installed pyinstaller. Type pyinstaller in the terminal and hit enter. It should recognize the command, but it will complain about more arguments.

6) Use the command "pyinstaller yourfile.py" to create your executable.

Hope this helped!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...