build文件夹和spec文件是使用pyinstaller创建可执行文件时的一部分。

huangapple go评论71阅读模式
英文:

What is the build folder and spec file when making exe file using pyinstaller?

问题

Q1. 当我使用pyinstaller创建一个exe文件时,会生成一个build文件夹和一个spec文件,这些是什么?

Q2. 即使我删除这些文件,运行exe文件没有问题吗?

Q3. 或者我在将exe文件分发到其他计算机时,需要将这些文件一起分发吗?

Q4. 另外,dist文件夹是什么?

当我删除build文件夹、spec文件和dist文件夹时,exe文件在我的计算机上仍然能够正常运行。

英文:

Q1. When I create an exe file with the pyinstaller, a build folder and a spec file are created, what are these?

Q2. Is there no problem in running exe file even if I delete these?

Q3. Or do I have to distribute these together when I distribute exe file to other computers?

Q4. additionally, what is the dist folder?

When I delete build folder, spec file and dist folder, the exe file executes well on my computer.

答案1

得分: 0

  1. 它们类似于PyInstaller的临时文件和配置文件。对于稍微高级的用法,您可以修改或手动创建特殊指令的规格文件,例如要包含或排除的模块等。
  2. 是的,在生成exe文件后,您可以删除它们,通常保留它们可以加速下次构建。
  3. 您不必与exe文件一起分发它们。
  4. 除非它是一个独立的应用程序,否则您需要将dist文件夹中的所有文件与exe文件一起才能在计算机上执行程序。如果您将其构建为独立应用程序,那么只需要exe文件。
英文:
  1. They are like temporary files and configuration files for PyInstaller. For a little advanced usage you can modify or manually create spec file with special instructions for build ..like modules to be included or excluded etc.
  2. Yes after exe is generated you can erase them, keeping them usually speeds up your next build
  3. you dont have to distribute them with exe.
  4. unless its a standalone, you will need all files in dist folder along with exe for the program to execute on your computer. In case you built it as standalone you will need, exe file only.

huangapple
  • 本文由 发表于 2023年2月6日 14:11:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75357875.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定