1

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.

Z.jiasen
  • 51
  • 4
  • Possible duplicate of https://stackoverflow.com/questions/49146/how-can-i-make-an-exe-file-from-a-python-program – rakesh.sahu Dec 14 '18 at 04:13

3 Answers3

1

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.

https://pyinstaller.readthedocs.io/en/stable/

Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
1

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.

nicholishen
  • 2,602
  • 2
  • 9
  • 13
1

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.

Z.jiasen
  • 51
  • 4