I've found that a lot of python libraries that install have xxx.exe files, such as scrapy.exe, pip.exe, virtualenv.exe, etc. in the Scripts directory. How do they do that?I can't find relevant information, please guide me, thank you very much. By the way, python is installed in the Windows system.
3 Answers
You can use PyInstaller. On Windows it can compile to a single .exe
file.
PyInstaller bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules. PyInstaller supports Python 2.7 and Python 3.4+, and correctly bundles the major Python packages such as numpy, PyQt, Django, wxPython, and others.

- 21,187
- 12
- 85
- 133
-
I think OP is talking about compiling Cpython packages from source. – nicholishen Dec 14 '18 at 03:49
-
python/Scripts/xxx.exe almost 101KB size, i feel it is not compiled to a single .exe file this way. – Z.jiasen Dec 14 '18 at 04:21
According to the docs you will need Build Tools for Visual Studio 2017 which can be downloaded directly from here
Alternatively, you could install Anaconda which comes packed with pre-compiled binaries.

- 2,602
- 2
- 9
- 13
i get my answer, it set entry_points ={'console_scripts':['xx'='yy']} in setup.py, when install or package, it can auto build .exe in Scripts directory.

- 51
- 4